3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
24 weaponskill () : Level(0), Hits(0), HitCounter(0) {}
25 int GetLevel () const { return Level
; }
26 int GetHits () const { return Hits
; }
30 virtual ~weaponskill () {}
31 virtual void Save (outputfile
&) const;
32 virtual void Load (inputfile
&);
33 virtual int GetLevelMap (int) const = 0;
34 virtual feuLong
GetUnuseTickMap (int) const = 0;
35 virtual int GetUnusePenaltyMap (int) const = 0;
44 class cweaponskill
: public weaponskill
{
46 virtual int GetLevelMap (int) const;
47 virtual feuLong
GetUnuseTickMap (int) const;
48 virtual int GetUnusePenaltyMap (int) const;
49 cchar
*GetName (int) const;
50 int GetBonus () const { return 1000+50*Level
; }
51 void AddLevelUpMessage (int) const;
52 void AddLevelDownMessage (int) const;
56 inline outputfile
&operator << (outputfile
&SaveFile
, const cweaponskill
&WeaponSkill
) {
57 WeaponSkill
.Save(SaveFile
);
62 inline inputfile
&operator >> (inputfile
&SaveFile
, cweaponskill
&WeaponSkill
) {
63 WeaponSkill
.Load(SaveFile
);
68 class sweaponskill
: public weaponskill
{
70 sweaponskill () : ID(0), Weight(0), Config(0) {}
71 sweaponskill (citem
*);
72 virtual int GetLevelMap (int) const;
73 virtual feuLong
GetUnuseTickMap (int) const;
74 virtual int GetUnusePenaltyMap (int) const;
75 int GetBonus () const { return Level
? 1150+25*(Level
-1) : 1000; }
76 void AddLevelUpMessage (cchar
*) const;
77 void AddLevelDownMessage (cchar
*) const;
78 virtual void Save (outputfile
&) const;
79 virtual void Load (inputfile
&);
80 truth
IsSkillOf (citem
*) const;
81 truth
IsSkillOfCloneMother (citem
*, feuLong
) const;
82 void SetID (feuLong What
) { ID
= What
; }
83 feuLong
GetID () const { return ID
; }
84 void PreProcessForBone () { ID
= -ID
; }
93 inline outputfile
&operator << (outputfile
&SaveFile
, const sweaponskill
*WeaponSkill
) {
94 WeaponSkill
->Save(SaveFile
);
99 inline inputfile
&operator >> (inputfile
&SaveFile
, sweaponskill
*&WeaponSkill
) {
100 WeaponSkill
= new sweaponskill
;
101 WeaponSkill
->Load(SaveFile
);