botnet power
This commit is contained in:
parent
fd17bf38df
commit
d48cbb38a4
7 changed files with 54 additions and 23 deletions
|
|
@ -2,6 +2,8 @@ extends Inventory
|
|||
|
||||
@export var install_button : Button
|
||||
@export var score_label : Label
|
||||
#@export var power_values : Dictionary[ItemData,int]
|
||||
@export var power_predict : RichTextLabel
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
|
@ -24,16 +26,23 @@ func _notification(what: int) -> void:
|
|||
|
||||
func check_server():
|
||||
if slots[0].item:
|
||||
if slots[0].item.item_name == "Server":
|
||||
if PlayerInventory.power_values.has(slots[0].item):
|
||||
install_button.disabled = false
|
||||
power_predict.text = "[color=green][wave]Device Power: " + str(PlayerInventory.power_values.get(slots[0].item))
|
||||
else:
|
||||
install_button.disabled = true
|
||||
power_predict.text = "[pulse]Insert a device to predict power"
|
||||
else:
|
||||
install_button.disabled = true
|
||||
power_predict.text = "[pulse]Insert a device to predict power"
|
||||
|
||||
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
PlayerInventory.botnet_servers += PlayerInventory.power_values.get(slots[0].item)
|
||||
PlayerInventory.botnet.append(slots[0].item)
|
||||
install_button.disabled = true
|
||||
power_predict.text = "[pulse]Insert a device to predict power"
|
||||
slots[0].item = null
|
||||
slots[0].update_ui()
|
||||
PlayerInventory.botnet_servers += 1
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://nfd41hcidmju"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://nfd41hcidmju"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://du0kijn4lh5kb" path="res://inv_system/botnet/botnet_panel.gd" id="1_m02i1"]
|
||||
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="2_ngfss"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_ti0ti"]
|
||||
font_color = Color(1, 0.75686276, 0, 0.4745098)
|
||||
|
||||
[node name="InventoryPanel" type="PanelContainer" node_paths=PackedStringArray("install_button", "score_label", "slots", "grid", "inv_label")]
|
||||
[node name="InventoryPanel" type="PanelContainer" node_paths=PackedStringArray("install_button", "score_label", "power_predict", "slots", "grid", "inv_label")]
|
||||
offset_left = 51.0
|
||||
offset_top = 67.0
|
||||
offset_right = 403.0
|
||||
offset_bottom = 259.0
|
||||
script = ExtResource("1_m02i1")
|
||||
install_button = NodePath("MarginContainer/VBoxContainer/Button")
|
||||
score_label = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/Label2")
|
||||
score_label = NodePath("MarginContainer/VBoxContainer/HBoxContainer2/score")
|
||||
power_predict = NodePath("MarginContainer/VBoxContainer/predict")
|
||||
inventory_name = "Install in Botnet"
|
||||
slots = [NodePath("MarginContainer/VBoxContainer/HBoxContainer/GridContainer/ItemSlot")]
|
||||
type = "Install"
|
||||
|
|
@ -49,18 +47,20 @@ layout_mode = 2
|
|||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Add a completed server to your botnet, (your main goal!)"
|
||||
text = "Add a completed device to your botnet, (your main goal!)"
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="predict" type="RichTextLabel" parent="MarginContainer/VBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0.5921569)
|
||||
layout_mode = 2
|
||||
text = "(this action cannot be undone)"
|
||||
label_settings = SubResource("LabelSettings_ti0ti")
|
||||
bbcode_enabled = true
|
||||
text = "[pulse]Insert a device to predict power"
|
||||
fit_content = true
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Install completed server"
|
||||
text = "Install Device"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
|
@ -68,9 +68,9 @@ alignment = 1
|
|||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Servers in your botnet:"
|
||||
text = "Total Botnet Power:"
|
||||
|
||||
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
[node name="score" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ extends Node
|
|||
@export var money : int = 0
|
||||
@export var money_label : Label
|
||||
@export var botnet_servers : int = 0
|
||||
@export var botnet : Array[ItemData] = []
|
||||
@export var power_values : Dictionary[ItemData,int]
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://bkhg56q71vsjv"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://bkhg56q71vsjv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://jxkjnscuxcyi" path="res://inv_system/player_inventory.gd" id="1_vk2kx"]
|
||||
[ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="2_hk4hx"]
|
||||
[ext_resource type="Script" uid="uid://dccraom7a7e8d" path="res://inv_system/item_data.gd" id="2_l456l"]
|
||||
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="3_8qgtd"]
|
||||
[ext_resource type="Resource" uid="uid://be540abaa08ox" path="res://items/server.tres" id="3_77dmv"]
|
||||
[ext_resource type="Script" uid="uid://chxgum3v3d1o7" path="res://crafting/recipe book/recipie_book.gd" id="4_bdgfq"]
|
||||
[ext_resource type="Resource" uid="uid://b3uytlkfvj67f" path="res://items/gaming_computer.tres" id="4_txpda"]
|
||||
[ext_resource type="Script" uid="uid://drm5jfhadys7l" path="res://crafting/recipe book/scavengeBook.gd" id="5_bdgfq"]
|
||||
[ext_resource type="Resource" uid="uid://8vw85c1qrypm" path="res://items/computer.tres" id="5_klg10"]
|
||||
[ext_resource type="Resource" uid="uid://bvcquf4e43r6r" path="res://items/laptop.tres" id="6_xr7r7"]
|
||||
[ext_resource type="Resource" uid="uid://3afonee3dw7" path="res://items/nas_item.tres" id="7_g2557"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_icm48"]
|
||||
content_margin_left = 0.0
|
||||
|
|
@ -47,6 +53,13 @@ script = ExtResource("1_vk2kx")
|
|||
inventory_panel = NodePath("Inventory")
|
||||
button = NodePath("Button")
|
||||
money_label = NodePath("PanelContainer/Label")
|
||||
power_values = Dictionary[ExtResource("2_l456l"), int]({
|
||||
ExtResource("3_77dmv"): 10,
|
||||
ExtResource("4_txpda"): 4,
|
||||
ExtResource("5_klg10"): 2,
|
||||
ExtResource("6_xr7r7"): 3,
|
||||
ExtResource("7_g2557"): 2
|
||||
})
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
visible = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue