24 lines
978 B
GDScript
24 lines
978 B
GDScript
extends "res://scripts/game/game.gd"
|
|
|
|
func _ready() -> void:
|
|
super._ready()
|
|
# Keep the demonstration safe and the drops outside the attraction radius.
|
|
player.set_physics_process(false)
|
|
player.get_node("WeaponController").set_physics_process(false)
|
|
for enemy in get_tree().get_nodes_in_group("enemies"):
|
|
enemy.set_physics_process(false)
|
|
for index in 2:
|
|
var item := ItemInstance.new()
|
|
item.definition = preload("res://resources/items/plasma_cannon.tres")
|
|
for addon in (5 if index == 1 else 3):
|
|
var modifier := ItemStatModifier.new()
|
|
modifier.stat_key = "damage_percent"
|
|
modifier.value = 1.0
|
|
item.additional_modifiers.append(modifier)
|
|
var pickup := Node2D.new()
|
|
pickup.set_script(preload("res://scripts/items/loot_pickup.gd"))
|
|
pickup.set("item", item)
|
|
pickup.position = player.position + Vector2(-190 if index == 0 else 190, -70)
|
|
add_child(pickup)
|
|
(pickup.get("_label") as Label).text = "3 ADDONY" if index == 0 else "5 ADDONÓW • MAKSIMUM"
|