botnet power
This commit is contained in:
parent
fd17bf38df
commit
d48cbb38a4
7 changed files with 54 additions and 23 deletions
|
|
@ -25,6 +25,9 @@ func show_recipe(recipe : CraftRecipe):
|
||||||
ingredient_slots[x].update_ui()
|
ingredient_slots[x].update_ui()
|
||||||
ingredient_slots[x].block_taking = true
|
ingredient_slots[x].block_taking = true
|
||||||
output_slot.item = recipe.output
|
output_slot.item = recipe.output
|
||||||
|
if (PlayerInventory.power_values.has(recipe.output)):
|
||||||
|
output_slot.extra_data = "Botnet Power: " + str(PlayerInventory.power_values.get(recipe.output))
|
||||||
|
|
||||||
output_slot.update_ui()
|
output_slot.update_ui()
|
||||||
output_slot.block_taking = true
|
output_slot.block_taking = true
|
||||||
output_label.text = recipe.output.item_name
|
output_label.text = recipe.output.item_name
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ extends Inventory
|
||||||
|
|
||||||
@export var install_button : Button
|
@export var install_button : Button
|
||||||
@export var score_label : Label
|
@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.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -24,16 +26,23 @@ func _notification(what: int) -> void:
|
||||||
|
|
||||||
func check_server():
|
func check_server():
|
||||||
if slots[0].item:
|
if slots[0].item:
|
||||||
if slots[0].item.item_name == "Server":
|
if PlayerInventory.power_values.has(slots[0].item):
|
||||||
install_button.disabled = false
|
install_button.disabled = false
|
||||||
|
power_predict.text = "[color=green][wave]Device Power: " + str(PlayerInventory.power_values.get(slots[0].item))
|
||||||
else:
|
else:
|
||||||
install_button.disabled = true
|
install_button.disabled = true
|
||||||
|
power_predict.text = "[pulse]Insert a device to predict power"
|
||||||
else:
|
else:
|
||||||
install_button.disabled = true
|
install_button.disabled = true
|
||||||
|
power_predict.text = "[pulse]Insert a device to predict power"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_button_pressed() -> void:
|
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].item = null
|
||||||
slots[0].update_ui()
|
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="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"]
|
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="2_ngfss"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_ti0ti"]
|
[node name="InventoryPanel" type="PanelContainer" node_paths=PackedStringArray("install_button", "score_label", "power_predict", "slots", "grid", "inv_label")]
|
||||||
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")]
|
|
||||||
offset_left = 51.0
|
offset_left = 51.0
|
||||||
offset_top = 67.0
|
offset_top = 67.0
|
||||||
offset_right = 403.0
|
offset_right = 403.0
|
||||||
offset_bottom = 259.0
|
offset_bottom = 259.0
|
||||||
script = ExtResource("1_m02i1")
|
script = ExtResource("1_m02i1")
|
||||||
install_button = NodePath("MarginContainer/VBoxContainer/Button")
|
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"
|
inventory_name = "Install in Botnet"
|
||||||
slots = [NodePath("MarginContainer/VBoxContainer/HBoxContainer/GridContainer/ItemSlot")]
|
slots = [NodePath("MarginContainer/VBoxContainer/HBoxContainer/GridContainer/ItemSlot")]
|
||||||
type = "Install"
|
type = "Install"
|
||||||
|
|
@ -49,18 +47,20 @@ layout_mode = 2
|
||||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
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
|
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
|
layout_mode = 2
|
||||||
text = "(this action cannot be undone)"
|
bbcode_enabled = true
|
||||||
label_settings = SubResource("LabelSettings_ti0ti")
|
text = "[pulse]Insert a device to predict power"
|
||||||
|
fit_content = true
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer"]
|
[node name="Button" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Install completed server"
|
text = "Install Device"
|
||||||
|
|
||||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
@ -68,9 +68,9 @@ alignment = 1
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||||
layout_mode = 2
|
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
|
layout_mode = 2
|
||||||
text = "0"
|
text = "0"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ extends Node
|
||||||
@export var money : int = 0
|
@export var money : int = 0
|
||||||
@export var money_label : Label
|
@export var money_label : Label
|
||||||
@export var botnet_servers : int = 0
|
@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.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
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://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://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="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="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="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"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_icm48"]
|
||||||
content_margin_left = 0.0
|
content_margin_left = 0.0
|
||||||
|
|
@ -47,6 +53,13 @@ script = ExtResource("1_vk2kx")
|
||||||
inventory_panel = NodePath("Inventory")
|
inventory_panel = NodePath("Inventory")
|
||||||
button = NodePath("Button")
|
button = NodePath("Button")
|
||||||
money_label = NodePath("PanelContainer/Label")
|
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="."]
|
[node name="Button" type="Button" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
@export var server_box : HBoxContainer
|
@export var server_box : HFlowContainer
|
||||||
@export var score_label : Label
|
@export var score_label : Label
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
|
@ -11,15 +11,16 @@ func _ready() -> void:
|
||||||
if slot.item:
|
if slot.item:
|
||||||
inv_sell_value += floori(slot.item.buy_value/float(2))
|
inv_sell_value += floori(slot.item.buy_value/float(2))
|
||||||
|
|
||||||
var server_item : ItemData = load("res://items/server.tres")
|
#var server_item : ItemData = load("res://items/server.tres")
|
||||||
for x in range(PlayerInventory.botnet_servers):
|
for device in PlayerInventory.botnet:
|
||||||
var new_slot : ItemSlot = load("res://inv_system/item_slot.tscn").instantiate()
|
var new_slot : ItemSlot = load("res://inv_system/item_slot.tscn").instantiate()
|
||||||
new_slot.item = server_item
|
new_slot.item = device
|
||||||
|
new_slot.extra_data = "Power: " + str(PlayerInventory.power_values.get(device))
|
||||||
new_slot.update_ui()
|
new_slot.update_ui()
|
||||||
new_slot.block_taking = true
|
new_slot.block_taking = true
|
||||||
server_box.add_child(new_slot)
|
server_box.add_child(new_slot)
|
||||||
|
|
||||||
score_label.text = str(PlayerInventory.botnet_servers) + " machines + $" + str(PlayerInventory.money + inv_sell_value)
|
score_label.text = str(PlayerInventory.botnet_servers) + " GHz + $" + str(PlayerInventory.money + inv_sell_value)
|
||||||
|
|
||||||
|
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
@ -36,6 +37,7 @@ func _on_reset_button_pressed() -> void:
|
||||||
PlayerInventory.inventory_panel.empty_grid()
|
PlayerInventory.inventory_panel.empty_grid()
|
||||||
Clock.days_left = 7
|
Clock.days_left = 7
|
||||||
Clock.time_left = 200
|
Clock.time_left = 200
|
||||||
|
PlayerInventory.botnet.clear()
|
||||||
PlayerInventory.show()
|
PlayerInventory.show()
|
||||||
Clock.show()
|
Clock.show()
|
||||||
get_tree().change_scene_to_file("res://scenes/workshop.tscn")
|
get_tree().change_scene_to_file("res://scenes/workshop.tscn")
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
script = ExtResource("1_2x1jc")
|
script = ExtResource("1_2x1jc")
|
||||||
server_box = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer")
|
server_box = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/botnet display")
|
||||||
score_label = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ScoreL")
|
score_label = NodePath("MarginContainer/PanelContainer/MarginContainer/VBoxContainer/ScoreL")
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="."]
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
|
|
@ -64,8 +64,10 @@ layout_mode = 2
|
||||||
text = "You launch your botnet filling the internet with catgirls!"
|
text = "You launch your botnet filling the internet with catgirls!"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
[node name="botnet display" type="HFlowContainer" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
theme_override_constants/h_separation = 8
|
||||||
|
theme_override_constants/v_separation = 8
|
||||||
alignment = 1
|
alignment = 1
|
||||||
|
|
||||||
[node name="ScoreL" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
[node name="ScoreL" type="Label" parent="MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue