Esempio n. 1
0
  /**
   * get xp and gold from killing characters
   *
   * @param Charac collision characters
   */
  public void KillXP(GameCharacter[] Charac) {
    // When the character dies
    for (int i = 0; i < Charac.length; i++) {
      if (Charac[i].ISDEAD && Charac[i].COLL_LISTENER) {

        Charac[i].COLL_LISTENER = false;
        audDEATH.playAudio("death.wav");

        // Remove collision listener
        for (int j = 0; j < FIREBALL.length; j++) {
          FIREBALL[j].removeCollChar(Charac[i]);
        }
        for (int j = 0; j < SHOCK.length; j++) {
          SHOCK[j].removeCollChar(Charac[i]);
        }
        for (int j = 0; j < DARKNESS.length; j++) {
          DARKNESS[j].removeCollChar(Charac[i]);
        }
        for (int j = 0; j < LIFE_DRAIN.length; j++) {
          LIFE_DRAIN[j].removeCollChar(Charac[i]);
        }

        // Add Xp
        STATS.IncreaseXP(10 * Charac[i].STATS.LEVEL);
        // Add Gold
        this.GOLD += Charac[i].GOLD;
      }
    }
  }
Esempio n. 2
0
 public void CompleteQuest(int Index) {
   Quest qstComp = QUEST_LIST.elementAt(Index);
   qstComp.STATUS = 3;
   qstComp.QUEST_GIVER.QUEST_LIST.elementAt(0).STATUS = 3;
   qstComp.QUEST_GIVER.QUEST_LIST.removeElementAt(0);
   STATS.IncreaseXP(qstComp.XP);
   GOLD += qstComp.GOLD;
 }