Scope admin tower to its co-op route and balance range
This commit is contained in:
1 parent
a536b698f7
commit
8777f28595
5 files changed
+44
-11
No files matched your search
@@ -206,7 +206,7 @@ var TOWER_DATA := [
|
||||
{"name": "EMP-PULS", "cost": 210, "damage": 20.0, "range": 215.0, "rate": 0.92, "shot_speed": 540.0, "damage_type": "EMP-FLÄCHE 118 · ALLE", "target_class": "both", "both_damage_scale": 1.0, "color": Color("77e8ff"), "unlock_cost": 24, "description": "Impuls trifft alle Luft- und Bodenziele im Radius mit 20 Schaden."},
|
||||
{"name": "RAILGUN", "cost": 300, "damage": 77.0, "range": 330.0, "rate": 1.85, "shot_speed": 1450.0, "damage_type": "PIERCING-STRAHL", "target_class": "both", "both_damage_scale": 0.70, "color": Color("c86bff"), "unlock_cost": 30, "description": "Lila Durchschlagsstrahl trifft alle Gegner auf seiner Schusslinie."},
|
||||
{"name": "FLAK", "cost": 210, "damage": 22.0, "range": 230.0, "rate": 0.42, "shot_speed": 920.0, "damage_type": "LUFT-EINZELZIEL", "target_class": "air", "color": Color("ff737c"), "unlock_cost": 0, "description": "Schnelle Abfangkanone gegen gegnerische Luftschiffe."},
|
||||
{"name": "ADMIN-TURM", "cost": 0, "damage": 1000000.0, "range": 3000.0, "rate": 0.08, "shot_speed": 3000.0, "damage_type": "TESTMODUS", "target_class": "both", "color": Color("fff2a1"), "unlock_cost": 0, "description": "Entwicklertest: besiegt jedes Ziel mit einem Schuss."}
|
||||
{"name": "ADMIN-TURM", "cost": 0, "damage": 1000000.0, "range": 650.0, "rate": 0.08, "shot_speed": 3000.0, "damage_type": "TESTMODUS", "target_class": "both", "color": Color("fff2a1"), "unlock_cost": 0, "description": "Entwicklertest: besiegt jedes Ziel mit einem Schuss."}
|
||||
]
|
||||
|
||||
var ENEMY_DATA := [
|
||||
@@ -638,6 +638,10 @@ func _apply_balance_config(config: Dictionary) -> bool:
|
||||
enemy["reward"] = clampi(int(values.get("reward", enemy.reward)), 0, 50000)
|
||||
enemy["breach_damage"] = clampi(int(values.get("breachDamage", enemy.breach_damage)), 1, 100)
|
||||
enemy["shield_resistance"] = clampf(float(values.get("shieldResistance", enemy.shield_resistance)), 0.01, 1.0)
|
||||
var admin_config = config.get("admin_tower", {})
|
||||
if admin_config is Dictionary:
|
||||
TOWER_DATA[ADMIN_TOWER_TYPE]["range"] = clampf(float(admin_config.get("range", 650.0)), 80.0, 1200.0)
|
||||
TOWER_DATA[ADMIN_TOWER_TYPE]["rate"] = clampf(float(admin_config.get("cooldown", 0.08)), 0.04, 20.0)
|
||||
return true
|
||||
|
||||
|
||||
@@ -936,6 +940,8 @@ func _find_target(tower: Dictionary) -> Dictionary:
|
||||
var best_is_shielded := false
|
||||
var effective_range := _tower_range(tower.type, tower.level)
|
||||
for enemy in enemies:
|
||||
if coop_mode and int(tower.type) == ADMIN_TOWER_TYPE and int(enemy.get("route_id", 0)) != (0 if tower.pos.x < COOP_MIRROR_X else 1):
|
||||
continue
|
||||
if _tower_can_target(tower.type, int(enemy.type)) and tower.pos.distance_to(enemy.pos) <= effective_range:
|
||||
var route: PackedVector2Array = _enemy_route(enemy)
|
||||
var progress: float = enemy.path_index * 1000.0 - enemy.pos.distance_to(route[enemy.path_index])
|
||||
@@ -1042,6 +1048,14 @@ func _update_projectiles(delta: float) -> void:
|
||||
func _apply_damage(enemy: Dictionary, amount: float, owner := 0, weapon_type := -1) -> void:
|
||||
if not enemies.has(enemy):
|
||||
return
|
||||
if weapon_type == ADMIN_TOWER_TYPE:
|
||||
enemy.shield = false
|
||||
enemy.shield_hp = 0.0
|
||||
enemy.hp = 0.0
|
||||
_award_credits(owner, int(enemy.reward))
|
||||
_spawn_burst(enemy.pos, Color("ff6b3d"), 11 + enemy.type * 4)
|
||||
enemies.erase(enemy)
|
||||
return
|
||||
var applied_damage := amount
|
||||
if bool(enemy.get("shield", false)):
|
||||
if weapon_type == 1:
|
||||
|
||||
Reference in new issue
Block a user