rocket launcher card insert
This commit is contained in:
21
growth/CardInjects/rocket_launcher_card_inject.gd
Normal file
21
growth/CardInjects/rocket_launcher_card_inject.gd
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var RocketProjectile: PackedScene
|
||||||
|
|
||||||
|
func activate(world, activator):
|
||||||
|
var rocket = RocketProjectile.instantiate()
|
||||||
|
var target = activator.get_target_pos()
|
||||||
|
rocket.position = activator.position
|
||||||
|
rocket.look_at(target)
|
||||||
|
if activator.get_collision_layer_bit(1): # player object
|
||||||
|
rocket.set_collision_layer_bit(1, false)
|
||||||
|
rocket.set_collision_layer_bit(2, true)
|
||||||
|
elif activator.get_collision_layer_bit(2): # enemy object
|
||||||
|
rocket.set_collision_layer_bit(1, true)
|
||||||
|
rocket.set_collision_layer_bit(2, false)
|
||||||
|
else:
|
||||||
|
assert(false, "who are you, activator?")
|
||||||
|
|
||||||
|
|
||||||
|
func discard(world, activator):
|
||||||
|
pass
|
||||||
1
growth/CardInjects/rocket_launcher_card_inject.gd.uid
Normal file
1
growth/CardInjects/rocket_launcher_card_inject.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bijee1o0qyiis
|
||||||
6
growth/CardInjects/rocket_launcher_card_inject.tscn
Normal file
6
growth/CardInjects/rocket_launcher_card_inject.tscn
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cquq44uspy17w"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bijee1o0qyiis" path="res://CardInjects/rocket_launcher_card_inject.gd" id="1_fa8xn"]
|
||||||
|
|
||||||
|
[node name="RocketLauncherCardInject" type="Node"]
|
||||||
|
script = ExtResource("1_fa8xn")
|
||||||
Reference in New Issue
Block a user