C:\Users\buildzoid\Desktop\GameEngineOnlyBranch\src\game\DCS.java
 1 // This class is the Dynamic Creature State. It contains all the data any creature in the game can carry and be queried for.
 2 // All non permanent stat changes are controlled by modifiers. At the end of a fight all mods get reset except for HPmod.
 3 // All stat scaling curves are done skill side. Therfore there is massive flexibility with creating very intresting stat boosting skills. 
 4 package game;
 5 
 6 public class DCS {
 7 
 8     private void loadstats() {
 9         basestats = creaturemanager.gbasestats(ID);
10     }
11 
12     public int HP() {
13         loadstats();
14         return basestats[0] * HPXP / 50000;
15     }
16 
17     int ID = -999; // this is what is used to pull all the 100% permanent data on a creature (grafiks and base stats)
18 
19     int[] basestats;
20     int action1;
21     int action2;
22     int action3;
23     int action4;
24     int special;
25 
26     //0
27     public int HPXP = 0; // this combined with base HP dictates how much HP a creature has
28     public int HPmod = 0; // when this + fullHP = 0 this creture is dead and cannot participate in a battle without getting resurrected
29 
30     //1
31     public int staminaXP = 0; //this combined with base stamina dictates how much stamina a creature has
32     public int staminamod = 0; //there are no rules as to what this can be as that allows for more intresting skills
33 
34     //2
35     public int strengthXP = 0; //this combined with base strength dictates how much strength a creature has
36     public int strengthmod = 0; // this can be no less than -strength
37 
38     //3
39     public int defenseXP = 0; //this combined with base defense dictates how much defense a creature has
40     public int defensemod = 0; // this can be no less than -defence
41 
42     //4
43     public int energyXP = 0; //this combined with base energy dictates how much energy a creature has 
44     public int energymod = 0; // there are no rules as to what this can be as that allows for more intresting skills
45 
46     //5
47     public int magicpowerXP = 0; //this combined with base magicpower dictates how much magicpower a creature has
48     public int magicpowermod = 0; // this can be no less than -magicpower
49 
50     //6
51     public int magicresistXP = 0; //this combined with base magicresist dictates how much magic resist a creature has
52     public int magicresistmod = 0; // this can be no less than -magicresist
53 
54     //7
55     public int spdXP = 0; //this combined with base strength dictates how much strength a creature has
56     public int spdMOD = 0;
57 
58     //8
59     public int XPrstamina = 0; //this combined with base strength dictates how much strength a creature has
60     public int rstaminamod = 0; // this modifies how fast your stamina regenrates
61 
62     //9
63     public int XPrenergy = 0; // this combined with the rengery base stat dictates how fast your energy regenrates
64     public int renergymod = 0; // this modifies how fast your energy regenrates, with a default behaviour in the combat engine is 
65 
66     // method to quickly boost all stats by an equal amount. Mostly for demo purposes
67     public void QuickXP(int XPgain) {
68         HPXP += XPgain;
69         staminaXP += XPgain;
70         strengthXP += XPgain;
71         defenseXP += XPgain;
72         energyXP += XPgain;
73         magicpowerXP += XPgain;
74         magicresistXP = XPgain;
75         spdXP += XPgain;
76         XPrstamina += XPgain;
77         XPrenergy += XPgain;
78     }
79 
80     //Set the XP of all attacks by a flat rate
81     public void SetXP(int XPgain) {
82         HPXP = XPgain;
83         staminaXP = XPgain;
84         strengthXP = XPgain;
85         defenseXP = XPgain;
86         energyXP = XPgain;
87         magicpowerXP = XPgain;
88         magicresistXP = XPgain;
89         spdXP = XPgain;
90         XPrstamina = XPgain;
91         XPrenergy = XPgain;
92     }
93 }
94