first-roguelike-elements #3
2 changed files with 11 additions and 5 deletions
|
|
@ -226,7 +226,6 @@ namespace TD.Combat
|
|||
private PlayerBuffManager GetOwnerBuffManager()
|
||||
{
|
||||
if (buffManagerResolved) return ownerBuffManager;
|
||||
buffManagerResolved = true;
|
||||
|
||||
var slot = towerInstance.Owner;
|
||||
if (slot == PlayerSlot.None) return null;
|
||||
|
|
@ -235,6 +234,7 @@ namespace TD.Combat
|
|||
if (matchState == null) return null;
|
||||
|
||||
ownerBuffManager = matchState.GetComponent<PlayerBuffManager>();
|
||||
buffManagerResolved = true;
|
||||
return ownerBuffManager;
|
||||
}
|
||||
|
||||
|
|
@ -434,7 +434,10 @@ namespace TD.Combat
|
|||
|
||||
private void HitEnemy(in CombatProfile p, EnemyHealth target, PlayerSlot owner)
|
||||
{
|
||||
float effectiveDamage = p.Damage * GetOwnerBuffManager()?.GetMultiplier(BuffStat.Damage) ?? 1f;
|
||||
var multiplier = GetOwnerBuffManager()?.GetMultiplier(BuffStat.Damage) ?? 1f;
|
||||
float effectiveDamage = p.Damage * multiplier;
|
||||
Debug.Log("multiplier: " + multiplier);
|
||||
Debug.Log("Effective damage: " + effectiveDamage);
|
||||
target.TakeDamage(effectiveDamage, p.DamageType, owner);
|
||||
ApplyStatusEffect(p, target, owner);
|
||||
}
|
||||
|
|
@ -478,7 +481,7 @@ namespace TD.Combat
|
|||
* (GetOwnerBuffManager()?.GetMultiplier(BuffStat.Damage) ?? 1f);
|
||||
proj.InitializeServer(
|
||||
target,
|
||||
p.Damage,
|
||||
effectiveDamage,
|
||||
p.DamageType,
|
||||
p.TargetType,
|
||||
p.SplashRadius,
|
||||
|
|
|
|||
|
|
@ -964,9 +964,12 @@ namespace TD.UI
|
|||
|
||||
private VisualElement CreateBuffMenuButton(Key hotkey)
|
||||
{
|
||||
// Key.None so HandleHotkeys doesn't register B here — BuilderInputController
|
||||
// already fires ToggleBuffMenu on B globally. Registering it in both places
|
||||
// causes a double-toggle on the same frame when the builder is selected.
|
||||
return CreateActionButton(
|
||||
costText: "Buffs",
|
||||
hotkey: hotkey,
|
||||
costText: "Buffs [B]",
|
||||
hotkey: Key.None,
|
||||
onClick: () => ToggleBuffMenu());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue