MainActor.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2007 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef MAINACTOR_H
00020 #define MAINACTOR_H
00021 
00022 #include "Actor.h"
00023 
00024 struct WeaponOverlayFrame;
00025 
00026 class MainActor : public Actor
00027 {
00028 public:
00029         MainActor();
00030         virtual ~MainActor();
00031 
00032         virtual bool CanAddItem(Item* item, bool checkwghtvol=false);
00033         virtual bool addItem(Item* item, bool checkwghtvol=false);
00034 
00036         virtual void teleport(int mapnum, sint32 x, sint32 y, sint32 z);
00037 
00041         void teleport(int mapnum, int teleport_id); // to teleportegg
00042 
00043         bool hasJustTeleported() const { return justTeleported; }
00044         void setJustTeleported(bool t) { justTeleported = t; }
00045 
00048         void accumulateStr(int n);
00049 
00052         void accumulateDex(int n);
00053 
00056         void accumulateInt(int n);
00057 
00059         virtual GravityProcess* ensureGravityProcess();
00060 
00061         virtual uint32 getArmourClass();
00062         virtual uint16 getDefenseType();
00063         virtual sint16 getAttackingDex();
00064         virtual sint16 getDefendingDex();
00065 
00066         virtual uint16 getDamageType();
00067         virtual int getDamageAmount();
00068 
00069         virtual void receiveHit(uint16 other, int dir, int damage, uint16 type);
00070 
00071         virtual void setInCombat();
00072         virtual void clearInCombat();
00073 
00074         virtual ProcId die(uint16 DamageType);
00075 
00076         std::string getName() { return name; }
00077         void setName(std::string name_) { name = name_; }
00078 
00079         bool loadData(IDataSource* ids, uint32 version);
00080 
00082         static void ConCmd_teleport(const Console::ArgvType &argv);
00084         static void ConCmd_mark(const Console::ArgvType &argv);
00086         static void ConCmd_recall(const Console::ArgvType &argv);
00088         static void ConCmd_listmarks(const Console::ArgvType &argv);
00090         static void ConCmd_name(const Console::ArgvType &argv);
00091 
00093         static void ConCmd_maxstats(const Console::ArgvType &argv);
00095         static void ConCmd_heal(const Console::ArgvType &argv);
00097         static void ConCmd_toggleInvincibility(const Console::ArgvType &argv);
00098 
00099 
00101         static void ConCmd_useBackpack(const Console::ArgvType &argv);
00103         static void ConCmd_useInventory(const Console::ArgvType &argv);
00105         static void ConCmd_useRecall(const Console::ArgvType &argv);
00107         static void ConCmd_useBedroll(const Console::ArgvType &argv);
00109         static void ConCmd_useKeyring(const Console::ArgvType &argv);
00110 
00112         static void ConCmd_toggleCombat(const Console::ArgvType &argv);
00113 
00114         // p_dynamic_cast stuff
00115         ENABLE_RUNTIME_CLASSTYPE();
00116 
00117         INTRINSIC(I_teleportToEgg);
00118         INTRINSIC(I_accumulateStrength);
00119         INTRINSIC(I_accumulateDexterity);
00120         INTRINSIC(I_accumulateIntelligence);
00121         INTRINSIC(I_clrAvatarInCombat);
00122         INTRINSIC(I_setAvatarInCombat);
00123         INTRINSIC(I_isAvatarInCombat);
00124 
00125         void getWeaponOverlay(const WeaponOverlayFrame*& frame, uint32& shape);
00126 
00127 
00128 protected:
00129         virtual void saveData(ODataSource* ods);
00130 
00131         void useInventoryItem(uint32 shapenum);
00132 
00133         bool justTeleported;
00134 
00135         int accumStr;
00136         int accumDex;
00137         int accumInt;
00138 
00139         std::string name;
00140 };
00141 
00142 #endif

Generated on Fri Jul 27 22:27:24 2007 for pentagram by  doxygen 1.4.7