#include "ai_update_giant_kill.cs" #include "rule_common.h" // SCORE 0~3 is cleared each round int SCORE_WIN = 0; int SCORE_DAMAGE = 1; int SCORE_DEAD = 2; int SCORE_FINAL = 3; int g_winScore; int g_giant1 = 0; int g_giant2 = 0; void RuleOnHostGame() { SpawnSceneItems(); SetGameMaxTime(0); var_ruleWinCondition = 1; if (var_ruleWinScore == 5) g_winScore = 20; else if (var_ruleWinScore == 10) g_winScore = 40; else if (var_ruleWinScore == 15) g_winScore = 60; else if (var_ruleWinScore == 20) g_winScore = 80; else g_winScore = 100; SpawnRobot(); } void RuleOnTimeOver() { GameOver(); } void SetGiant(int c) { SetCharaAttrib(c, CHARA_MAX_HP, var_ruleMaxHP*8); // ­ì¼Æ­È10 SetCharaAttrib(c, CHARA_HP, var_ruleMaxHP*8); // ­ì¼Æ­È10 SetCharaAttrib(c, CHARA_RAGE, 100); SetCharaGiant(c); SysMsg("Giant", c); if (g_giant1 == 0) g_giant1 = c; else g_giant2 = c; } void RuleOnNextRound() { RebornAllChara(); if (g_giant1) SetCharaAttrib(g_giant1, CHARA_RAGE, 100); if (g_giant2) SetCharaAttrib(g_giant2, CHARA_RAGE, 100); } int RuleOnCompareRank(int c1, int c2) { int s1, s2; s1 = GetCharaScore(c1, SCORE_WIN); s2 = GetCharaScore(c2, SCORE_WIN); if (s1 > s2) return 1; else if (s1 < s2) return -1; s1 = GetCharaScore(c1, SCORE_DAMAGE); s2 = GetCharaScore(c2, SCORE_DAMAGE); if (s1 > s2) return 1; else if (s1 < s2) return -1; s1 = GetCharaScore(c1, SCORE_DEAD); s2 = GetCharaScore(c2, SCORE_DEAD); if (s1 < s2) return 1; else if (s1 > s2) return -1; return 0; } void RuleOnComputeFinalScore(int c) { int sn = 0; if (GetCharaScore(c, SCORE_DAMAGE) > 0) sn = 1; int finalScore = GetCharaScore(c, SCORE_DAMAGE)*1 - GetCharaScore(c, SCORE_DEAD)*3 + (GetNumCharas()-GetCharaRoundRank(c)-1)*sn; if (finalScore < 0) finalScore = 0; SetCharaScore(c, SCORE_FINAL, finalScore); SetCharaNetScore(c, 0, GetCharaScore(c, SCORE_WIN)); // GLS_GIANT_SPEC_GIANT SetCharaNetScore(c, 1, GetCharaScore(c, SCORE_DAMAGE)); // GLS_GIANT_SPEC_DAMAGE int i, t, s; int teamAScore = 0; int teamBScore = 0; s = GetNumCharas(); for (i=0; iteamBScore) || (team==2 && teamBScore>teamAScore)) { // win SetCharaNetScore(c, 2, 1); // GLS_TEAMDEATHMATCH_SPEC_WIN SetCharaNetScore(c, 3, 0); // GLS_TEAMDEATHMATCH_SPEC_LOSE } else if ((team==1 && teamAScore= g_winScore) { SetCharaScore(killer, SCORE_WIN, 1); GameOver(); } else CharaReborn(c); } else { if (IsCharaFriend(c, killer)) SetCharaScore(killer, SCORE_DAMAGE, GetCharaScore(killer, SCORE_DAMAGE)-10); CharaReborn(c); } } ComputeHudScore(); } void RuleOnCharaEnter(int c) { SetCharaAttrib(c, CHARA_MAX_HP, var_ruleMaxHP); SetCharaAttrib(c, CHARA_HP, var_ruleMaxHP); if (GetCharaAttrib(c, CHARA_TEAM)==1) SetGiant(c); } void RuleOnCharaLeave(int c, int reason) { SpawnRobot(); int t1, t2, total; CountCharaTeamMembers(t1, t2); total = t1+t2; // chara will be deleted, can't get any chara attribute here, IsGiant(c) is undefined if (c==g_giant1 || c==g_giant2) { if (c == g_giant1) g_giant1 = 0; else g_giant2 = 0; if (g_giant1==0 && g_giant2==0 && total>0 && reason==0) { // no giant, game over int i, b; int n = GetNumCharas(); int score; int maxScore = -9999; int best = 0; for (i=0; i