Rebelling Peasants! (fixed)
notes: use == for comparison, = is for setting values. statusMsg needs to have a player as an argument but passing in an undefined player works fine. minor spelling mistakes and things mentioned in the forums also fixed. let me know if you have any questions. -angel
void configGame()
{
addAIPlayer("Evil Fish","Crypt Doctor",0);
}
bool notInPlay;
string enchantName;
Player P0;
void afterStart()
{
infoBox("P.S.","And by the way, did I forget to mention that the priests of the local church will aid you? Apparently they're not too happy about losing their Glory-Gaining Church of Holy Worship, as well as an ancient relic and a mystical Observatory.One guy has a tendency to explode when an Enchant is played, so be careful.");
infoBox("Dear Mr. Mighty Warlord Dude","There are angry serfs everywhere! They rage at you in a fury, appearing from many farmlands. The more passive ones have holed up inside their little cottages waiting to ambush you at a moment's notice, so get fighting! I also advise a bit of caution on burning their farms.-From Zblader");
}
void beforeStart()
{
Player aiPlayer=getAIPlayer(0);
enchantName = "Peasant Army";
createEntity(enchantName,createLocation(-1,-1),aiPlayer);
createEntity("Observatory",11,2,aiPlayer);
createEntity("Hadarck's Throne",11,1,aiPlayer);
createEntity("Cathedral of Xosa",10,2,aiPlayer);
aiPlayer.addToDeck("Craig Scout",0);
aiPlayer.addToDeck("Craig Scout",0);
aiPlayer.addToDeck("Craig Scout",0);
aiPlayer.addToDeck("Pilgrim",0);
aiPlayer.addToDeck("Pilgrim",0);
aiPlayer.addToDeck("Pilgrim",0);
setTerrain(createLocation(11,2),4,1);
setTerrain(createLocation(11,1),2,3);
setTerrain(createLocation(10,2),2,3);
}
int x = 0;
int y = 0;
int randi()
{
return rand(11);
}
int rando(){
return rand(12);
}
void onNewRound()
{
y++;
Player player=getHumanPlayer(0);
Player aiPlayer=getAIPlayer(0);
notInPlay = true;
forEachEntity();
if(notInPlay)
{
x++;
createEntity(enchantName,createLocation(-1,-1),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
infoBox("Dear Mr. Mighty Warlord Dude","I hope you have witnessed our courage and bravery, but you will pay for the attempted destruction of our farms! - The Peasants");
}
if (x==2)
{
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
infoBox("Dear Mr. Mighty Warlord Dude","The peasants seem angry. Maybe you destroyed too many of their farms?- Zblader");
}
if (y==5)
{
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
infoBox("Dear Mr. Mighty Warlord Dude","The peasants seem angry. The rebellion intensifies.- X");
statusMsg(P0,"A deafening roar of a mob is heard...");
}
if (y==7)
{
createEntity("Craig Scout",1,2,player);
createEntity("Elven Scout",1,1,player);
infoBox("Dear Mr. Mighty Warlord Dude","I have received word your situation is growing worse dealing with the rebels. With the little flux I can spare, take these two scouts. They will loyally serve you to the death.");
setTerrain(createLocation(1,2),2,3);
setTerrain(createLocation(1,1),2,3);
}
if (y==10)
{
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
infoBox("Dear Mr. Mighty Warlord Dude","The peasants seem angry. The rebellion intensifies.- X");
statusMsg(P0,"A deafening roar of a mob is heard...");
}
if (y>15)
{
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
createEntity("Pilgrim",rando(),randi(),aiPlayer);
statusMsg(P0,"aiPlayer, FOR CHUCK NORRISIANISM!");
}
if (y==14)
{
createEntity("Soldier",1,2,player);
createEntity("Dwarven Warrior",1,1,player);
createEntity("Osin Faith Healer",2,1,player);
createEntity("Drunken Mortar Team",2,2,player);
infoBox("Dear Mr. Mighty Warlord Dude","I warn you that you are leaving the rebellion to happen too long. Many enemies are abound. Make haste to finish them, or you shall die quickly.-Zblader");
}
createEntity("Rebellious Serfs",rando(),randi(),aiPlayer);
}
bool entityCallback(Entity ent){
if(ent.getName() == enchantName ){
notInPlay = false;
return false;
}
return true;
}