#include "ai_update_1on1.cs" #include "rule_common.h" // SCORE 0~3 is cleared each round int SCORE_KILL = 0; int SCORE_MAX_CONT_KILL = 1; int SCORE_TOP = 2; int SCORE_FINAL = 3; int SCORE_CONT_KILL = 4; int King = 0; void RuleOnHostGame() { SpawnSceneItems(); if (var_ruleWinCondition == 0) SetGameMaxTime(var_ruleRoundTime); else SetGameMaxTime(0); var_ruleTeamHurt = 0; SpawnRobot(); // get current AI number int c, s; s = GetNumCharas(); for (int i = 0 ; i < s ; i++) { c = GetChara(i); if (!GetCharaPlayer(c)) { // tell AI go to teleport point AIPerform(c, AI_PERFORM_NONE); AIPerform(c, AI_PERFORM_MOVETOPOINT, 0); } } } void RuleOnTimeOver() { GameOver(); } void RuleOnNextRound() { int i, s, c; s = GetNumCharas(); for (i=0; i s2) return 1; else if (s1 < s2) return -1; s1 = GetCharaScore(c1, SCORE_MAX_CONT_KILL); s2 = GetCharaScore(c2, SCORE_MAX_CONT_KILL); if (s1 > s2) return 1; else if (s1 < s2) return -1; s1 = GetCharaScore(c1, SCORE_TOP); s2 = GetCharaScore(c2, SCORE_TOP); if (s1 > s2) return 1; else if (s1 < s2) return -1; return 0; } void RuleOnComputeFinalScore(int c) { int sn = 0; if (GetCharaScore(c, SCORE_KILL) > 0) sn = 1; int finalScore = (GetCharaScore(c, SCORE_KILL)*1 + (GetNumCharas()-GetCharaRoundRank(c)-1)*sn)*1; if (finalScore < 0) finalScore = 0; SetCharaScore(c, SCORE_FINAL, finalScore); SetCharaScore(c, SCORE_CONT_KILL, 0); SetCharaNetScore(c, 0, GetCharaScore(c, SCORE_KILL)); // GLS_ONEONONE_SPEC_CHAMPION SetCharaNetScore(c, 1, GetCharaScore(c, SCORE_MAX_CONT_KILL)); // GLS_ONEONONE_SPEC_CHAMPSREIAL SetCharaNetScore(c, 2, GetCharaPlayTime(c)); // GLS_ONEONONE_SPEC_TIME SetCharaNetScore(c, 3, GetCharaScore(c, SCORE_FINAL)); // GLS_ONEONONE_SPEC_RATING } void ComputeHudScore() { int i, c, s; int maxScore = 0; int bestKiller = 0; s = GetNumCharas(); for (i=0; i maxScore) { bestKiller = c; maxScore = GetCharaScore(c, SCORE_KILL); } } SetHudNumber(bestKiller, maxScore); } void RuleOnCharaDead(int c, int killer) { // CharaReborn(c); } void Rule1On1Over(int winner, int loser, int level) { if (level == 2) { SetCharaScore(winner, SCORE_TOP, GetCharaScore(winner, SCORE_TOP)+1); } if (level == 3) { SetCharaScore(winner, SCORE_KILL, GetCharaScore(winner, SCORE_KILL)+1); if (winner == King) { SetCharaScore(winner, SCORE_CONT_KILL, GetCharaScore(winner, SCORE_CONT_KILL)+1); if (GetCharaScore(winner, SCORE_CONT_KILL) > GetCharaScore(winner, SCORE_MAX_CONT_KILL)) SetCharaScore(winner, SCORE_MAX_CONT_KILL, GetCharaScore(winner, SCORE_CONT_KILL)); } else { King = winner; SetCharaScore(winner, SCORE_CONT_KILL, 1); if (GetCharaScore(winner, SCORE_CONT_KILL) > GetCharaScore(winner, SCORE_MAX_CONT_KILL)) SetCharaScore(winner, SCORE_MAX_CONT_KILL, GetCharaScore(winner, SCORE_CONT_KILL)); } if (var_ruleWinCondition == 1) { if (GetCharaScore(winner, SCORE_KILL) >= var_ruleWinScore) GameOver(); } } ComputeHudScore(); } void RuleOnCharaEnter(int c) { SetCharaAttrib(c, CHARA_MAX_HP, var_ruleMaxHP); SetCharaAttrib(c, CHARA_HP, var_ruleMaxHP); SetCharaAttrib(c, CHARA_TEAM, 1); } void RuleOnCharaLeave(int c, int reason) { ComputeHudScore(); SpawnRobot(); }