3792: Add hammer_hit_fire_delay tune r=heinrich5991 a=def-

as requested by J$ON for new map with Genex

the current hammer_fire_delay is only used when no other tee has been
hit. In order not to change any existing behaviour I have added a new
tune for the case of hitting, instead of making the existing one control
both.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2021-05-01 14:43:45 +00:00 committed by GitHub
commit 3becd45ea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View file

@ -356,7 +356,10 @@ void CCharacter::FireWeapon()
// if we Hit anything, we have to wait for the reload
if(Hits)
m_ReloadTimer = GameWorld()->GameTickSpeed() / 3;
{
float FireDelay = GetTuning(m_TuneZone)->m_HammerHitFireDelay;
m_ReloadTimer = FireDelay * GameWorld()->GameTickSpeed() / 1000;
}
}
break;

View file

@ -463,7 +463,14 @@ void CCharacter::FireWeapon()
// if we Hit anything, we have to wait for the reload
if(Hits)
m_ReloadTimer = Server()->TickSpeed() / 3;
{
float FireDelay;
if(!m_TuneZone)
FireDelay = GameServer()->Tuning()->m_HammerHitFireDelay;
else
FireDelay = GameServer()->TuningList()[m_TuneZone].m_HammerHitFireDelay;
m_ReloadTimer = FireDelay * Server()->TickSpeed() / 1000;
}
}
break;

View file

@ -52,9 +52,10 @@ MACRO_TUNING_PARAM(ExplosionStrength, explosion_strength, 6.0f, "Explosion stren
MACRO_TUNING_PARAM(HammerStrength, hammer_strength, 1.0f, "Hammer strength")
MACRO_TUNING_PARAM(HookDuration, hook_duration, 1.25f, "Hook duration")
MACRO_TUNING_PARAM(HammerFireDelay, hammer_fire_delay, 125, "Delay of hammering")
MACRO_TUNING_PARAM(HammerFireDelay, hammer_fire_delay, 125, "Delay of hammering (when hitting nothing)")
MACRO_TUNING_PARAM(GunFireDelay, gun_fire_delay, 125, "Delay of firing gun")
MACRO_TUNING_PARAM(ShotgunFireDelay, shotgun_fire_delay, 500, "Delay of firing shotgun")
MACRO_TUNING_PARAM(GrenadeFireDelay, grenade_fire_delay, 500, "Delay of firing grenade")
MACRO_TUNING_PARAM(LaserFireDelay, laser_fire_delay, 800, "Delay of firing laser laser")
MACRO_TUNING_PARAM(NinjaFireDelay, ninja_fire_delay, 800, "Delay of firing ninja")
MACRO_TUNING_PARAM(HammerHitFireDelay, hammer_hit_fire_delay, 320, "Delay of hammering (when hitting another tee)")