oh man i fixed that status effect bug
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
class_name CardPrinter extends StaticBody3D
|
||||
|
||||
@export var button_collider: CollisionShape3D
|
||||
@export var button_box: Node3D
|
||||
|
||||
#TODO: use faction enum
|
||||
var base_faction: int = 1
|
||||
@ -37,6 +36,7 @@ func generate_rarity() -> int:
|
||||
|
||||
func randomize_cards(faction: Card.Faction) -> void:
|
||||
#TODO: no magic numbers, asshole! 3 = cards to spawn
|
||||
var pos_x: float = 0.0
|
||||
for x: int in 3:
|
||||
var decided_rarity: int = generate_rarity()
|
||||
var card_choices: Array[Card] = get_faction_cards(faction)
|
||||
@ -58,7 +58,10 @@ func randomize_cards(faction: Card.Faction) -> void:
|
||||
card_array.erase(card)
|
||||
var item: CardItem = reply_player.hero_class.card_item.instantiate() as CardItem
|
||||
item.set_card(card)
|
||||
item.position = Vector3(x, 1, 2)
|
||||
item.position = Vector3(pos_x, 2, 0)
|
||||
pos_x *= -1
|
||||
if pos_x >= 0:
|
||||
pos_x += 1.25
|
||||
item.pressed.connect(card_picked_up)
|
||||
spawned_cards.append(item)
|
||||
add_child(item)
|
||||
@ -71,13 +74,11 @@ func card_picked_up(card_item: CardItem) -> void:
|
||||
spawned_card.queue_free()
|
||||
spawned_cards = []
|
||||
button_collider.disabled = false
|
||||
button_box.position = Vector3(0,0,0)
|
||||
$StaticBody3D/AudioStreamPlayer3D.play()
|
||||
|
||||
|
||||
func _on_static_body_3d_button_interacted(_value: int, reply: Hero) -> void:
|
||||
reply_player = reply
|
||||
button_collider.disabled = true
|
||||
button_box.position = Vector3(0,0,-0.2)
|
||||
$StaticBody3D/AudioStreamPlayer3D.play()
|
||||
randomize_cards(reply.hero_class.faction)
|
||||
|
@ -2,34 +2,26 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://bivtfdl3p1brv" path="res://Scenes/CardPrinter/card_printer.gd" id="1_qft15"]
|
||||
[ext_resource type="Script" uid="uid://dkfswql8ui0bt" path="res://Scripts/interact_button.gd" id="4_eavi1"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6i5w3mowcfcs" path="res://drafting_table.glb" id="4_kpujb"]
|
||||
[ext_resource type="AudioStream" uid="uid://dknygn5eyuhxt" path="res://Audio/shot1.wav" id="5_m033a"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_s02au"]
|
||||
albedo_color = Color(0.203922, 0.592157, 0.592157, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_0ebt5"]
|
||||
size = Vector3(2, 2.1, 1)
|
||||
size = Vector3(2.17, 1.55307, 1.12)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ikdwj"]
|
||||
size = Vector3(1.29447, 0.342125, 0.277604)
|
||||
size = Vector3(2.20033, 0.260753, 1.27008)
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_73g2w"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("5_m033a")
|
||||
|
||||
[node name="CardPrinter" type="StaticBody3D" node_paths=PackedStringArray("button_collider", "button_box")]
|
||||
[node name="CardPrinter" type="StaticBody3D" node_paths=PackedStringArray("button_collider")]
|
||||
script = ExtResource("1_qft15")
|
||||
button_collider = NodePath("StaticBody3D/CollisionShape3D2")
|
||||
button_box = NodePath("StaticBody3D/CollisionShape3D2/CSGBox3D")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05, 0)
|
||||
size = Vector3(2, 2.1, 1)
|
||||
material = SubResource("StandardMaterial3D_s02au")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.776539, 0.0332634)
|
||||
shape = SubResource("BoxShape3D_0ebt5")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="."]
|
||||
@ -38,17 +30,18 @@ collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("4_eavi1")
|
||||
press_cost = 15
|
||||
hover_text = "[center]#Interact# to spend $15 on random card"
|
||||
hover_text = "[center]#Interact# draft a card for $15"
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, -6.55949e-05, 0.349496, -0.579584)
|
||||
shape = SubResource("BoxShape3D_ikdwj")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D/CollisionShape3D2"]
|
||||
size = Vector3(1.29447, 0.342125, 0.277604)
|
||||
|
||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.010989, -0.086501)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.578748, -0.587001)
|
||||
stream = SubResource("AudioStreamRandomizer_73g2w")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="drafting_table" parent="." instance=ExtResource("4_kpujb")]
|
||||
transform = Transform3D(0.06, 0, 0, 0, 0.06, 0, 0, 0, 0.06, 0, 0.385809, 0)
|
||||
|
||||
[connection signal="button_interacted" from="StaticBody3D" to="." method="_on_static_body_3d_button_interacted"]
|
||||
|
Reference in New Issue
Block a user