Aaaaaaah... Seems we didnt test properly xD
Remember when amount of Holy's only refreshed after mouse over?
When used up all your Holy's the icon doesnt appear, and so you can't mouse over... The next turn you suddenly have 2 Holy's.
Fuck fuck fuck
I was trying to start the +1 holy only after every1 had 1 turn (so like Delay 1) and after all this trying & testing i thought i had it, but now it's still fucked xD
Code:
require utils, stepsutils, p_utils;
void holy_war_extension::FirstFrame()
{
ShowMessage("");
ShowMessage("Good luck & Have fun. Start the HOLY WAR!");
GG->WriteToChat(GG->curFont+3," ---------------------------- H O L Y W A R ------------------------------",false);
GG->WriteToChat(GG->curFont+1," - All weapons except the Holy Hand-Grenade end turn",false);
GG->WriteToChat(GG->curFont+1," - You can stockpile your unused Holy Grenades",false);
GG->WriteToChat(GG->curFont+1," - There is 1 emergency Girder in your inventory which does not end the turn",false);
GG->WriteToChat(GG->curFont+3," ---------------- G O O D L U C K & H A V E F U N ----------------------",false);
}
bool HHG_turn_started;
int turn_number;
int loop_number;
int first_team;
override void CTurnGame::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData)
{
super;
if (Type == M_TURNBEGIN)
{
HHG_turn_started = true;
}
if (Type == M_TURNEND)
{
HHG_turn_started = false;
}
}
override void CWorm::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData)
{
super;
local w = GetCurrentWorm();
// Set HHG amout = 0 for all worms AT FIRST FRAME of the game.
if (Type == M_FRAME && gframe == 1) // require stepsutils to be loaded;
{
local Weap = GetWeaponByName("Holy Hand-Grenade");
GS->Info.SetWeaponEx(WormTeam, Weap->GetWeaponIndex(), Weap->GetPageIndex(), 0);
}
// Add +1 HHG for current worm only when his turn starts.
if (Type == M_FRAME && w != NullObj && w->WormTeam==WormTeam) // require p_utils to be loaded;
{
if (HHG_turn_started)
{
local Weap = GetWeaponByName("Holy Hand-Grenade");
turn_number = turn_number + 1;
if(turn_number == 1){
first_team = w->WormTeam;
}
if(w->WormTeam == first_team){
loop_number = loop_number + 1;
}
if(loop_number > 0){
//GG->WriteToChat(GG->curFont+3,"Add to existing Holys", false);
GS->Info.SetWeaponEx(WormTeam, Weap->GetWeaponIndex(), Weap->GetPageIndex(), Weap->Count+1);
}
if(loop_number == 2){
//GG->WriteToChat(GG->curFont+3,"Set Holys to 1", false);
GS->Info.SetWeaponEx(WormTeam, Weap->GetWeaponIndex(), Weap->GetPageIndex(), 1);
ShowMessage("Yay, Holy's =)");
}
HHG_turn_started = false;
}
}
}