Skip to content

Instantly share code, notes, and snippets.

@demoth
Created November 16, 2012 18:09
Show Gist options
  • Save demoth/4089515 to your computer and use it in GitHub Desktop.
Save demoth/4089515 to your computer and use it in GitHub Desktop.
exp
/*
==============================================================================
EXPERIENCE SYSTEM A - POINTS PER KILL
==============================================================================
*/
float XP_ARMY = 5;
float XP_ENFORCER = 10;
float XP_DOG = 10;
float XP_KNIGHT = 15;
float XP_OGRE = 20;
float XP_HKNIGHT = 30;
float XP_FIEND = 50;
float XP_WIZARD = 40;
float XP_SHAMBLER = 100;
float XP_TARBABY = 40;
float XP_VORE = 90;
float XP_ZOMBIE = 15;
string(string src, float len) strpadl =
{
if ( strlen(src) >= len )
{
return src;
}
else
{
local string result = src;
do
{
result = " ";
//result = strcat(" ", result);
} while ( TRUE )
}
};
void(entity to, entity from) AddExp = {
if ( to.classname != "player" )
return;
if ( !from.flags & FL_MONSTER )
return;
// TODO: chech for level and stuff
to.exp = to.exp + from.exp;
/*
if (to.classname == "player")
{
sprint(to, "You now have ");
sprint(to, tally);
sprint(to, " Experience Points\n");
}
*/
};
void(entity self) MenuStats = {
//string xp, str, dex, intel, vit, fres, cres, lres, pres, phres, stats, level;
local string message;
message = self.netname;
centerprint(self, strcat("you:", message));
//centerprint(self, "You now have ^2",tally ,"^7 Experience Points\n", "asdf\n","asdfasdf");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment