the first thing I would do is take all of your defines and capatalize them, this makes them easy to see in the rest of the code:
Here is how i set up my defines:
Code:
//Interaction
#define ATTACKABLE skill1
#define TEAM skill2
#define LEVEL skill3
#define CLASS skill4
#define DRUID 1
#define FIGHTER 2
#define HEALER 3
#define MAGICIAN 4
#define SCOUT 5
#define THIEF 6
//Ranges
#define SCAN_RANGE skill5
#define AGGRO_RANGE skill6
And how I see it in the code:
Code:
action players_code ()
{
player = my;
//Keep me on the ground
attach_to_ground_player();
//Interaction
if(!my.ATTACKABLE) my.ATTACKABLE = 1; //Player is attackable
if(!my.TEAM) my.TEAM = 2; //Player team
if(!my.LEVEL) my.LEVEL = 1; //Player level
if(!my.CLASS) my.CLASS = FIGHTER; //Player class
That's just personal preference. The second thing I would do is get use to "for" loops for doing checking, counting, etc. The are faster than while loops and also need less code.
You look like you have a good start, but i would take my initial values for the player and put them at the top, and then take all of the values that can change during gaemplay, and put them in a while loop, such as:
Code:
while (player != NULL)
{
if (my.health=>100) my.health=100;
if (my.ammo =<1) reload();
if (my.weaponid==1) my.maxammo = 32;
}
Also if you notice, I don't have brackets after those if statements. Save ya bit of time, becaue if you only have ONE instruction after an "if" statement, you don't need to include brackets.
Good Luck!!!
Jesse