sorry I broke I shit again lol
This commit is contained in:
@@ -34,15 +34,23 @@ axis_stretch_vertical = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 50
|
||||
theme_override_constants/margin_top = 50
|
||||
theme_override_constants/margin_right = 50
|
||||
theme_override_constants/margin_bottom = 50
|
||||
script = ExtResource("3_j30jg")
|
||||
|
||||
[node name="VSplitContainer" type="VSplitContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Art" type="TextureRect" parent="MarginContainer/VSplitContainer"]
|
||||
custom_minimum_size = Vector2(300, 300)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource("4_op1lx")
|
||||
expand_mode = 4
|
||||
expand_mode = 1
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="VSplitContainer2" type="VSplitContainer" parent="MarginContainer/VSplitContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cmuig2rqt65f3"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cmuig2rqt65f3"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b0g5wd4n3py3x" path="res://BaseCard/BaseCard.tscn" id="1_3qnhj"]
|
||||
[ext_resource type="PackedScene" uid="uid://bf1241le7dwfs" path="res://CardInjects/CursorGun/CursorGunCardInject.tscn" id="2_rrs0u"]
|
||||
[ext_resource type="Texture2D" uid="uid://dpd4hnlfynh0i" path="res://assets/icons/Cursor_projectile_symbol.png" id="3_rrs0u"]
|
||||
|
||||
[node name="Card" instance=ExtResource("1_3qnhj")]
|
||||
behaviors = [ExtResource("2_rrs0u")]
|
||||
art = ExtResource("3_rrs0u")
|
||||
title = "Cursor"
|
||||
description = "Shoots a pick"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bbjra84inrnnu"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bbjra84inrnnu"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b0g5wd4n3py3x" path="res://BaseCard/BaseCard.tscn" id="1_jb1yu"]
|
||||
[ext_resource type="PackedScene" uid="uid://otxia3v8iw07" path="res://CardInjects/Firewall/FirewallCardInject.tscn" id="2_il4cq"]
|
||||
[ext_resource type="Texture2D" uid="uid://binpnf3e537h2" path="res://assets/icons/Firewall_symbol.png" id="3_il4cq"]
|
||||
|
||||
[node name="Card" instance=ExtResource("1_jb1yu")]
|
||||
behaviors = [ExtResource("2_il4cq")]
|
||||
art = ExtResource("3_il4cq")
|
||||
title = "Firewall"
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cwrwbf1ib5845"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cwrwbf1ib5845"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b0g5wd4n3py3x" path="res://BaseCard/BaseCard.tscn" id="1_j4w8m"]
|
||||
[ext_resource type="PackedScene" uid="uid://cquq44uspy17w" path="res://CardInjects/RocketLauncher/rocket_launcher_card_inject.tscn" id="2_203iy"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvt5ki8w2tdg6" path="res://assets/icons/Rocket_launcher_cursor.png" id="3_203iy"]
|
||||
|
||||
[node name="Card" instance=ExtResource("1_j4w8m")]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -215.0
|
||||
offset_top = -681.0
|
||||
offset_right = 215.0
|
||||
offset_bottom = 0.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
behaviors = [ExtResource("2_203iy")]
|
||||
art = ExtResource("3_203iy")
|
||||
title = "Rocket Launcher"
|
||||
|
||||
[node name="MarginContainer" parent="." index="2"]
|
||||
script = null
|
||||
|
||||
@@ -2,17 +2,17 @@ extends Control
|
||||
|
||||
@export var player: NodePath
|
||||
@export var world: NodePath
|
||||
@export const drawpile: Array[PackedScene] = [
|
||||
@export var drawpile: Array[PackedScene] = [
|
||||
preload("res://Cards/FirewallCard.tscn"),
|
||||
preload("res://Cards/FirewallCard.tscn"),
|
||||
preload("res://Cards/CursorGunCard.tscn"),
|
||||
preload("res://Cards/CursorGunCard.tscn"),
|
||||
preload("res://Cards/DashCard.tscn"),
|
||||
preload("res://Cards/DashCard.tscn"),
|
||||
preload("res://Cards/ShieldCard.tscn"),
|
||||
preload("res://Cards/ShieldCard.tscn"),
|
||||
preload("res://Cards/OverclockCard.tscn"),
|
||||
preload("res://Cards/OverclockCard.tscn"),
|
||||
#preload("res://Cards/ShieldCard.tscn"),
|
||||
#preload("res://Cards/ShieldCard.tscn"),
|
||||
#preload("res://Cards/OverclockCard.tscn"),
|
||||
#preload("res://Cards/OverclockCard.tscn"),
|
||||
]
|
||||
|
||||
var active_card_index = 0
|
||||
@@ -23,11 +23,8 @@ func _ready() -> void:
|
||||
for card in drawpile:
|
||||
card.instantiate()
|
||||
drawpile.shuffle();
|
||||
for i in range(get_node(player).hand_size):
|
||||
draw_card()
|
||||
|
||||
var actual_dash_card = dash_card_scene.instantiate()
|
||||
$HBoxContainer/Slot1.add_child(actual_dash_card)
|
||||
#for i in range(get_node(player).hand_size):
|
||||
#draw_card()
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_pressed("play_card"):
|
||||
@@ -44,7 +41,7 @@ func play_card():
|
||||
card.activate(get_node(world), get_node(player));
|
||||
print(active_card_index)
|
||||
|
||||
func discard(self):
|
||||
func discard():
|
||||
var cards = get_cards();
|
||||
if active_card_index >= 0 and active_card_index < cards.size():
|
||||
var card = cards[active_card_index]
|
||||
@@ -53,14 +50,15 @@ func discard(self):
|
||||
discard_pile.append(card)
|
||||
get_card_container().remove_child(card)
|
||||
|
||||
active_card_index = min(active_card_index, hand.size() - 1);
|
||||
#active_card_index = min(active_card_index, hand.size() - 1);
|
||||
draw_card();
|
||||
|
||||
func cycle_card(index_shift):
|
||||
if hand.size() > 0:
|
||||
active_card_index = (active_card_index + index_shift) % hand.size();
|
||||
else:
|
||||
draw_card();
|
||||
#if hand.size() > 0:
|
||||
#active_card_index = (active_card_index + index_shift) % hand.size();
|
||||
#else:
|
||||
#draw_card();
|
||||
pass
|
||||
|
||||
func draw_card():
|
||||
if drawpile.size() == 0:
|
||||
@@ -81,8 +79,8 @@ func shuffle_deck():
|
||||
func get_cards() -> Array:
|
||||
return get_card_container().get_children()
|
||||
|
||||
func get_card_container() -> Array:
|
||||
return $MarginContainer/HBoxContainer
|
||||
func get_card_container():
|
||||
return $HBoxContainer
|
||||
|
||||
func get_active_card() -> Card:
|
||||
return get_cards().get(active_card_index)
|
||||
func get_active_card():
|
||||
return get_cards().get(active_card_index).get_node("Card")
|
||||
|
||||
@@ -1,63 +1,53 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://co8jnr2dew5ts"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://co8jnr2dew5ts"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bykc0ufv25ij5" path="res://hand.gd" id="1_u4p2i"]
|
||||
[ext_resource type="PackedScene" uid="uid://ee0t3qv6gyam" path="res://Cards/DashCard.tscn" id="2_wymn8"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwrwbf1ib5845" path="res://Cards/RocketLauncherCard.tscn" id="3_3q536"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbjra84inrnnu" path="res://Cards/FirewallCard.tscn" id="4_6wjrw"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmuig2rqt65f3" path="res://Cards/CursorGunCard.tscn" id="2_bfasp"]
|
||||
|
||||
[node name="Hand" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -20.0
|
||||
offset_top = -40.0
|
||||
offset_right = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
scale = Vector2(0.255, 0.255)
|
||||
script = ExtResource("1_u4p2i")
|
||||
player = NodePath("../../Player")
|
||||
world = NodePath("../..")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_right = 460.0
|
||||
offset_bottom = 484.0
|
||||
offset_left = -604.0
|
||||
offset_top = -484.0
|
||||
offset_right = 604.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Slot1" type="PanelContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Card2" parent="HBoxContainer/Slot1" instance=ExtResource("3_3q536")]
|
||||
[node name="Card" parent="HBoxContainer/Slot1" instance=ExtResource("2_bfasp")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Slot2" type="Control" parent="HBoxContainer"]
|
||||
visible = false
|
||||
[node name="Slot2" type="PanelContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Card" parent="HBoxContainer/Slot2" instance=ExtResource("2_wymn8")]
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = 0.0
|
||||
offset_top = 0.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 681.0
|
||||
|
||||
[node name="Slot3" type="Control" parent="HBoxContainer"]
|
||||
visible = false
|
||||
[node name="Card" parent="HBoxContainer/Slot2" instance=ExtResource("2_bfasp")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Card" parent="HBoxContainer/Slot3" instance=ExtResource("4_6wjrw")]
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = 0.0
|
||||
offset_top = 0.0
|
||||
offset_right = 430.0
|
||||
offset_bottom = 681.0
|
||||
[node name="Slot3" type="PanelContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Card" parent="HBoxContainer/Slot3" instance=ExtResource("2_bfasp")]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -15,7 +15,7 @@ var shield_active = true;
|
||||
var move_direction = Vector2.ZERO;
|
||||
var target = Vector2.ZERO # The position of the player's cursor.
|
||||
|
||||
@export var hand;
|
||||
@export var hand: Control;
|
||||
|
||||
var screen_size # Size of the game window.
|
||||
var action_state = ActionState.None
|
||||
@@ -73,18 +73,19 @@ func dash():
|
||||
dash_on_cooldown = true;
|
||||
|
||||
func draw_card():
|
||||
if drawpile.size() == 0:
|
||||
shuffle_deck();
|
||||
if drawpile.size() > 0 and hand.size() < hand_size:
|
||||
var card = drawpile.pop_back();
|
||||
hand.append(card);
|
||||
if active_card_index == -1:
|
||||
active_card_index = 0;
|
||||
#if drawpile.size() == 0:
|
||||
#shuffle_deck();
|
||||
#if drawpile.size() > 0 and hand.size() < hand_size:
|
||||
#var card = drawpile.pop_back();
|
||||
#hand.append(card);
|
||||
#if active_card_index == -1:
|
||||
#active_card_index = 0;
|
||||
pass
|
||||
|
||||
func _ready():
|
||||
screen_size = get_viewport_rect().size
|
||||
while (hand.size() < hand_size and drawpile.size() > 0):
|
||||
draw_card();
|
||||
#while (hand.size() < hand_size and drawpile.size() > 0):
|
||||
#draw_card();
|
||||
|
||||
func _process(delta):
|
||||
update_target_coords();
|
||||
|
||||
Reference in New Issue
Block a user