mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-01 07:31:04 +00:00
(WIP) Start implementing ICombatant
Start by replacing `hitMob` with `takeDamage` interface function. Simplify `pcAttackChars` a little by utilizing the new interface, then add more interface functions as needed. A lot of the combat logic is tied to the `Mob` class. Need to start moving stuff over to CombatNPC.
This commit is contained in:
@@ -78,9 +78,11 @@ public:
|
||||
ICombatant() {}
|
||||
virtual ~ICombatant() {}
|
||||
|
||||
virtual void takeDamage(EntityRef, int) = 0;
|
||||
virtual int takeDamage(EntityRef, int) = 0;
|
||||
virtual void heal(EntityRef, int) = 0;
|
||||
virtual bool isAlive() = 0;
|
||||
virtual int getCurrentHP() = 0;
|
||||
virtual int32_t getID() = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -136,9 +138,11 @@ struct CombatNPC : public BaseNPC, public ICombatant {
|
||||
|
||||
virtual bool isExtant() override { return hp > 0; }
|
||||
|
||||
virtual void takeDamage(EntityRef src, int amt) override;
|
||||
virtual int takeDamage(EntityRef src, int amt) override;
|
||||
virtual void heal(EntityRef src, int amt) override;
|
||||
virtual bool isAlive() override;
|
||||
virtual int getCurrentHP() override;
|
||||
virtual int32_t getID() override;
|
||||
};
|
||||
|
||||
// Mob is in MobAI.hpp, Player is in Player.hpp
|
||||
|
||||
Reference in New Issue
Block a user