From dbee845a5cfb6ca419604ac984d1845440f76007 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Tue, 3 Jun 2025 16:00:35 -0300 Subject: more spells --- src/creature.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/creature.cc') diff --git a/src/creature.cc b/src/creature.cc index 65beee0..d1cb7bf 100644 --- a/src/creature.cc +++ b/src/creature.cc @@ -56,14 +56,16 @@ void TCreature::Attack(void){ this->Combat.Attack(); } -// TODO(fusion): This probably belongs elsewhere but we should come back to +// Temporary Location +// ============================================================================= +// ============================================================================= +// TODO(fusion): These probably belong elsewhere but we should come back to // this when we're wrapping up creature files. + bool IsCreaturePlayer(uint32 CreatureID){ return CreatureID < 0x40000000; } -// TODO(fusion): This probably belongs elsewhere but we should come back to -// this when we're wrapping up creature files. void AddKillStatistics(int AttackerRace, int DefenderRace){ // NOTE(fusion): I think the race name can be "human" only for players, // which means we're probably tracking how many creatures are killed by @@ -80,6 +82,20 @@ void AddKillStatistics(int AttackerRace, int DefenderRace){ } } +int GetRaceByName(const char *RaceName){ + int Result = 0; + for(int Race = 1; Race < NARRAY(RaceData); Race += 1){ + if(stricmp(RaceName, RaceData[Race].Name) == 0){ + Result = Race; + break; + } + } + return Result; +} + +// ============================================================================= +// ============================================================================= + int TCreature::Damage(TCreature *Attacker, int Damage, int DamageType){ if(this->IsDead || this->Type == NPC){ return 0; -- cgit v1.2.3