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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue