diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-30 20:12:36 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-30 20:12:36 -0300 |
| commit | 08780dad536eb5d0544eb2ea70e5443dc237976f (patch) | |
| tree | 673a57b538ca9016d5b386ff32c3bd67c2190c2f /src/creature.cc | |
| parent | dff5e62f6ebb1b06c234b9144458788893b6ca86 (diff) | |
| download | game-08780dad536eb5d0544eb2ea70e5443dc237976f.tar.gz game-08780dad536eb5d0544eb2ea70e5443dc237976f.zip | |
more work on `crcombat.cc`
Diffstat (limited to 'src/creature.cc')
| -rw-r--r-- | src/creature.cc | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/src/creature.cc b/src/creature.cc index 119d0e7..a02cb82 100644 --- a/src/creature.cc +++ b/src/creature.cc @@ -51,54 +51,6 @@ TCreature::TCreature(void) : } } -// TODO(fusion): Probably better to figure out how TCombat and Object work. - -// Creature Functions -//============================================================================== -// TODO(fusion): This was the first function I attempted to cleanup but soon -// realized we should start with the building blocks of the codebase, namely -// TSkill, TSkillBase, etc... -// We should probably come back to this once we start doing creature functions -// again. -void CheckMana(TCreature *Creature, int ManaPoints, int SoulPoints, int Delay){ - if(Creature == NULL){ - error("CheckMana: Übergebene Kreatur existiert nicht.\n"); - throw ERROR; - } - - if(Creature->Type != PLAYER || ManaPoints < 0) - return; - - TSkill *Mana = Creature->Skills[SKILL_MANA]; - if(Mana == NULL){ - error("CheckMana: Kein Skill MANA!\n"); - throw ERROR; - } - - TSkill *Soul = Creature->Skills[SKILL_SOUL]; - if(Soul == NULL){ - error("CheckMana: Kein Skill SOULPOINTS!\n"); - throw ERROR; - } - - if(!CheckRight(Creature->ID, UNLIMITED_MANA)){ - if(Mana->Get() < ManaPoints) - throw NOTENOUGHMANA; - - if(Soul->Get() < SoulPoints) - throw NOTENOUGHSOULPOINTS; - - Mana->Change(-ManaPoints); - Soul->Change(-SoulPoints); - } - - if(ManaPoints > 0){ - Creature->Skills[SKILL_MAGIC_LEVEL]->Increase(ManaPoints); - } - - // NOTE(fusion): Maintain largest exhaust? - uint32 EarliestSpellTime = ServerMilliseconds + Delay; - if(Creature->EarliestSpellTime < EarliestSpellTime){ - Creature->EarliestSpellTime = EarliestSpellTime; - } +void TCreature::Attack(void){ + this->Combat.Attack(); } |
