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
15 #include "ivancommon.h"
26 weaponskill () : Level(0), Hits(0), HitCounter(0) {}
27 virtual ~weaponskill () {}
29 int GetLevel () const { return Level
; }
30 int GetHits () const { return Hits
; }
35 virtual void Save (outputfile
&) const;
36 virtual void Load (inputfile
&);
37 virtual int GetLevelMap (int) const = 0;
38 virtual feuLong
GetUnuseTickMap (int) const = 0;
39 virtual int GetUnusePenaltyMap (int) const = 0;
48 class cweaponskill
: public weaponskill
{
50 virtual ~cweaponskill () {}
52 virtual int GetLevelMap (int) const;
53 virtual feuLong
GetUnuseTickMap (int) const;
54 virtual int GetUnusePenaltyMap (int) const;
55 cchar
*GetName (int) const;
56 int GetBonus () const { return 1000+50*Level
; }
57 void AddLevelUpMessage (int) const;
58 void AddLevelDownMessage (int) const;
62 inline outputfile
&operator << (outputfile
&SaveFile
, const cweaponskill
&WeaponSkill
) {
63 WeaponSkill
.Save(SaveFile
);
68 inline inputfile
&operator >> (inputfile
&SaveFile
, cweaponskill
&WeaponSkill
) {
69 WeaponSkill
.Load(SaveFile
);
74 class sweaponskill
: public weaponskill
{
76 sweaponskill () : ID(0), Weight(0), Config(0) {}
77 sweaponskill (citem
*);
78 virtual ~sweaponskill () {}
80 virtual int GetLevelMap (int) const;
81 virtual feuLong
GetUnuseTickMap (int) const;
82 virtual int GetUnusePenaltyMap (int) const;
83 int GetBonus () const { return Level
? 1150+25*(Level
-1) : 1000; }
84 void AddLevelUpMessage (cchar
*) const;
85 void AddLevelDownMessage (cchar
*) const;
86 virtual void Save (outputfile
&) const;
87 virtual void Load (inputfile
&);
88 truth
IsSkillOf (citem
*) const;
89 truth
IsSkillOfCloneMother (citem
*, feuLong
) const;
90 void SetID (feuLong What
) { ID
= What
; }
91 feuLong
GetID () const { return ID
; }
92 void PreProcessForBone () { ID
= -ID
; }
101 inline outputfile
&operator << (outputfile
&SaveFile
, const sweaponskill
*WeaponSkill
) {
102 WeaponSkill
->Save(SaveFile
);
107 inline inputfile
&operator >> (inputfile
&SaveFile
, sweaponskill
*&WeaponSkill
) {
108 WeaponSkill
= new sweaponskill
;
109 WeaponSkill
->Load(SaveFile
);