Skip to content

Instantly share code, notes, and snippets.

@s5bug
Created October 27, 2018 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s5bug/051112391aefc77b9165d48d6f89eac5 to your computer and use it in GitHub Desktop.
Save s5bug/051112391aefc77b9165d48d6f89eac5 to your computer and use it in GitHub Desktop.
else if(game.words[0] == "nyan1")
{
if(game.playernum == 1)
{
game.player[1].health++;
if(game.player[1].health > game.player[1].defaulthp)
{
game.player[1].health = game.player[1].defaulthp;
}
}
}
else if(game.words[0] == "nyan2")
{
if(game.playernum == 0)
{
game.player[0].health++;
if(game.player[0].health > game.player[0].defaulthp)
{
game.player[0].health = game.player[0].defaulthp;
}
}
}
else if(game.words[0] == "opendoor")
{
map.opendoor(int(game.words[2]));
}
else if(game.words[0] == "closedoor")
{
map.closedoor(int(game.words[2]));
}
else if(game.words[0] == "damage1" || game.words[0] == "damage2")
{
game.enemy[int(game.words[2])].health = game.enemy[int(game.words[2])].health - int(game.words[3]);
if(game.enemy[int(game.words[2])].health <= 0)
{
if(game.words[0] == "damage1")
{
if(game.playernum == 0)
{
game.chatconnection.send("kill",game.username,int(game.words[2]));
game.globalconsolemessage("!",game.username + " has defeated an enemy!");
tmp = game.player[game.playernum].level;
game.player[game.playernum].levelup();
if(tmp != game.player[game.playernum].level)
{
game.globalconsolemessage("!",game.username + " has leveled up!");
game.levelbonus(game.player[game.playernum].level);
}
}
}
else if(game.playernum == 1)
{
game.chatconnection.send("kill",game.username,int(game.words[2]));
game.globalconsolemessage("!",game.username + " has defeated an enemy!");
tmp2 = game.player[game.playernum].level;
game.player[game.playernum].levelup();
if(tmp2 != game.player[game.playernum].level)
{
game.globalconsolemessage("!",game.username + " has leveled up!");
}
}
}
else
{
if(game.words[0] == "damage1")
{
if(game.playernum == 0)
{
game.localconsolemessage("!!","Enemy attacked " + game.words[1] + " for " + game.words[4] + " damage");
game.player[game.playernum].health = game.player[game.playernum].health - int(game.words[4]);
}
}
else if(game.playernum == 1)
{
game.localconsolemessage("!!","Enemy attacked " + game.words[1] + " for " + game.words[4] + " damage");
game.player[game.playernum].health = game.player[game.playernum].health - int(game.words[4]);
}
if(game.words[0] == "damage1")
{
if(game.playernum == 0)
{
if(game.player[game.playernum].health <= 0)
{
game.die();
}
}
}
else if(game.playernum == 1)
{
if(game.player[game.playernum].health <= 0)
{
game.die();
}
}
}
}
else if(game.words[0] == "hairdamage1" || game.words[0] == "hairdamage2")
{
game.enemy[int(game.words[2])].health = game.enemy[int(game.words[2])].health - int(game.words[3]);
if(game.enemy[int(game.words[2])].health <= 0)
{
if(game.words[0] == "hairdamage1")
{
if(game.playernum == 0)
{
game.chatconnection.send("kill",game.username,int(game.words[2]));
game.globalconsolemessage("!",game.username + " has defeated an enemy!");
ttmp = game.player[game.playernum].level;
game.player[game.playernum].levelup();
if(ttmp != game.player[game.playernum].level)
{
game.globalconsolemessage("!",game.username + " has leveled up!");
game.levelbonus(game.player[game.playernum].level);
}
}
}
else if(game.playernum == 1)
{
game.chatconnection.send("kill",game.username,int(game.words[2]));
game.globalconsolemessage("!",game.username + " has defeated an enemy!");
ttmp2 = game.player[game.playernum].level;
game.player[game.playernum].levelup();
if(ttmp2 != game.player[game.playernum].level)
{
game.globalconsolemessage("!",game.username + " has leveled up!");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment