diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-06-03 16:00:35 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-06-03 16:00:35 -0300 |
| commit | dbee845a5cfb6ca419604ac984d1845440f76007 (patch) | |
| tree | f3a0e626c70867f01805c35ac6ad243e3df04a2f /src/creature.cc | |
| parent | a1e062c8b27fcf2f65d5a21fc85fbcc80abfa86f (diff) | |
| download | game-dbee845a5cfb6ca419604ac984d1845440f76007.tar.gz game-dbee845a5cfb6ca419604ac984d1845440f76007.zip | |
more spells
Diffstat (limited to 'src/creature.cc')
| -rw-r--r-- | src/creature.cc | 22 |
1 files changed, 19 insertions, 3 deletions
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; |
