home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar Special 2004 September
/
GSSH0904CD1.iso
/
MedievalLords
/
MedievalLordsMaps.exe
/
004400650073006500720074.scn
/
Desert_Gameplay.scp
< prev
next >
Wrap
Text File
|
2004-09-14
|
13KB
|
469 lines
// CrΘation des variables
s32 delaimodif;
s32 delai;
s32 goldviking;
s32 NbrAttackViking;
s32 Choix;
s32 pop_seuil;
s32 seuil_max;
s32 Message_avertissement;
s32 V2_Free;
s32 fief_sarasins_Dead;
s32 voleurs_sarasins_Dead;
s32 Message_objective1_ok;
s32 Message_objective2_ok;
s32 Message_objective3_ok;
s32 Enough_Plow;
s32 Enough_Watermill;
s32 Enough_Windmill;
s32 Enough_UpgradeProduction;
s32 InitGame()
{
// Inutile: ScΘnario α downloader
// SetMissionID(7,0);
StopAllFunctions();
InitVariables();
SetMonthYear(0,1000);
LockPrototypeDestruction("wells",1);
SetKeyTitle("DESERT_TITLE");
SetKeyHistory("DESERT_BRIEFING");
BlockPosingCell( "CELL_124" );
AddForbiddenProto("5_Architect_Workshop"); // On bloque ces technologies pour le scΘnario
AddForbiddenProto("Wells"); // On bloque ces technologies pour le scΘnario
AddForbiddenProto("Fountain");
AddForbiddenProto("Worked_Fountain");
Objective1Start(); // On lance le premier objectif
s32 TreasureStart;
TreasureStart = 2000.0*Diff_GetTreasureAtStartFactor();
SetTreasure(TreasureStart);
ExecEverySec("BeginFood", 2);
InitVariables();
CreateEnemies();
// VΘrification des technologies rΘcupΘrΘes sur le terrain + Terrain gagnΘ
Army_SetOnLooseSiegeFunction("desert_V2","Set_V2_Free");
Army_SetOnLooseSiegeFunction("desert_V1","Check_voleurs_sarasins_Dead");
// VΘrification des technologies rΘcupΘrΘes sur le terrain
Army_SetOnLooseAllInvasionFunction("fief_sarasins","CheckRecupTechno_fief");
Army_SetOnLooseSiegeFunction("desert_V3","CheckRecupTechno_V3");
// ShowStartGame("DESERT_OBJECTIFS");
ExplicationDesert();
SetObjective(1,"DESERT_OBJECTIFS_01");
SetObjective(2,"DESERT_OBJECTIFS_02");
SetObjective(3,"DESERT_OBJECTIFS_03");
PrepareCityLevelAndUpsetStandard();
PrepareCityLevelAndUpset_Desert(); // RΘglage de la baisse des taxes si pas de modifications bien_Ωtre des habitants
SetPercentSoldiersMax(50);
InitGeneralsToDungeons();
}
s32 InitVariables() // On initialise les variables α 0
{
delaimodif = 0;
delai = 480;
goldviking = 3000;
NbrAttackViking = 0;
seuil_max = 800;
pop_seuil = 200;
Message_avertissement = 0;
V2_Free = 0;
fief_sarasins_Dead = 0;
voleurs_sarasins_Dead = 0;
Message_objective1_ok = 0;
Message_objective1_ok = 0;
Message_objective1_ok = 0;
Enough_Plow = 0;
Enough_Watermill = 0;
Enough_Windmill = 0;
Enough_UpgradeProduction = 0;
}
//=====================
//= Les Brigands sont ΘliminΘs
s32 Set_V2_Free(mcString name)
{
V2_Free = 1;
}
s32 ExplicationDesert()
{
ExecInFewSec("Cut_scene_on",0);
BlocAllInterfaceExceptWidget("BOX_USERMESSAGE_PAUSE_TEXT_CLOSE_BUTTON");
SetCurCameraDirectionNbMilliSec(4000,5024.6,4515.2,26000.0,45518.9,48789.5,-71266.0);
SetCurCameraDirectionNbMilliSec(2000,5024.6,4515.2,26000.0,45518.9,48789.5,-71266.0);
SetCurCameraDirectionNbMilliSec(4000,57547.3,22716.8,26000.0,90570.9,72811.1,-75162.1);
SetCurCameraDirectionNbMilliSec(3000,57547.3,22716.8,26000.0,90570.9,72811.1,-75162.1);
SetCurCameraDirectionNbMilliSec(4000,133547.4,26194.0,26000.0,130239.1,86102.8,-75177.0);
SetCurCameraDirectionNbMilliSec(2000,133547.4,26194.0,26000.0,130239.1,86102.8,-75177.0);
SetCurCameraDirectionNbMilliSec(4000,133192.0,122367.4,26000.0,148781.2,180306.8,-74159.3);
SetCurCameraDirectionNbMilliSec(2000,133192.0,122367.4,26000.0,148781.2,180306.8,-74159.3);
SetCurCameraDirectionNbMilliSec(4000,5024.6,4515.2,26000.0,45518.9,48789.5,-71266.0);
StopBlocAllInterface();
Cut_scene_off();
MessageUserPause("DESERT_INDICATIONS");
ShowStartGame("DESERT_OBJECTIFS");
}
s32 CheckRecupTechno_fief(mcString name)
{
fief_sarasins_Dead =1;
MessageUserPause("DESERT_FIEF_SARASINS_DEAD");
UndoForbiddenProto("5_Architect_Workshop");
}
s32 CheckRecupTechno_V3(mcString name)
{
UndoForbiddenProto("5_Architect_Workshop");
}
s32 Check_voleurs_sarasins_Dead(mcString name)
{
voleurs_sarasins_Dead =1;
MessageUserPause("DESERT_VOLEURS_SARASINS_DEAD");
}
//==============================================================================
void StartGame()
{
ForcePlayerConstruction("Fortified_House"); // Le joueur doit commencer par poser sa Fortified House
SetWaterSecurityFeelingLevel(2);
SetRazziaDelay(240);
SetRazziaAleaDelay(120);
SetWaitPeriodBeforeFirstRazzia(420);
SetCataGlobalFactor(1.0); //pour rΘgler gloalement la force des cata
}
//==============================================================================
// Condition de dΘfaite : prise de la maison fortifiΘe
s32 FailCondition1()
{
if(IsMainTowerDestroyed())
{
ExecInFewSec("Defeat_Message_Condition1",3);
}
}
// Condition de dΘfaite : autre que prise de la maison fortifiΘe
s32 Defeat_Message_Condition1()
{
PlayerDefeat("LOOSE_DUNGEON");
}
//==============================================================================
//==============================================================================
s32 Objective1Start()
{
ExecEverySec("Objective1TestEnd", 5);
}
s32 BeginFood()
{
if (GetNbGranaries()>0)
{
StopFunction("BeginFood");
DeclareCataDesert(); // On lance la dΘclaration des diffΘrentes catastrophes (voir Terres_Cata.scp)
ExecInFewSec("TestCataDesert",600); // On execute le lancement d'un catastrophe dans X secondes (voir Terres_Cata.scp)
s32 FoodStart;
FoodStart = 400.0*Diff_GetFoodAtStartFactor();
SetFood (FoodStart);
ExecInFewSecNoBattle("Check_Invasion", delai);
ExecEverySec("Seuil", 10);
ExecEverySec("POP_OBJ_TEST", 10);
ExecEverySec("FailCondition1", 5);
UnblockPosingCell( "CELL_124" );
}
}
s32 POP_OBJ_TEST()
{
if(V2_Free == 1)
{
if (Message_objective1_ok==0)
{
MessageUserPause("OBJECTIVE1_OK");
Message_objective1_ok=1;
}
SetObjectiveSucceed(1);
}
if(V2_Free != 1)
{
SetObjectiveFailed(1);
}
Enough_Plow=((GetNbProtoOnTerritory("Plow","CELL_124"))+(GetNbProtoOnTerritory("plow","CELL_2220"))+(GetNbProtoOnTerritory("plow","CELL_2223")));
Enough_Watermill=((GetNbProtoOnTerritory("Watermill","CELL_124"))+(GetNbProtoOnTerritory("Watermill","CELL_2220"))+(GetNbProtoOnTerritory("Watermill","CELL_2223")));
Enough_Windmill=((GetNbProtoOnTerritory("Windmill","CELL_124"))+(GetNbProtoOnTerritory("Windmill","CELL_2220"))+(GetNbProtoOnTerritory("Windmill","CELL_2223")));
if((Enough_Plow >= 4 ) && (Enough_Watermill >= 4) && (Enough_Windmill >= 4))
{
Enough_UpgradeProduction = 1;
if (Message_objective2_ok==0)
{
lightmessage ("OBJECTIVE2_OK","GFX_ADVISOR_POP_UP_SELECTION",10,5);
Message_objective2_ok=1;
}
SetObjectiveSucceed(2);
}
else
{
SetObjectiveFailed(2);
}
if(GetNbHousesByLevelOnTerritory( 7,"CELL_124")>=15)
{
if (Message_objective3_ok==0)
{
lightmessage ("OBJECTIVE3_OK","GFX_ADVISOR_POP_UP_SELECTION",10,5);
Message_objective1_ok=1;
}
SetObjectiveSucceed(3);
}
if(GetNbHousesByLevelOnTerritory( 7,"CELL_124")<15)
{
SetObjectiveFailed(3);
}
}
s32 Objective1TestEnd()
{
if((V2_Free == 1) && ( Enough_UpgradeProduction == 1) && (GetNbHousesByLevelOnTerritory( 7,"CELL_124")>=15))
{
StopFunction("Objective1TestEnd"); // pour arreter cette fonction particuliΦre
SetObjectiveSucceed(1);
PlayerVictory("DESERT_DEBRIEFING");
// On dΘbloque toutes les technologies par sΘcuritΘ.
UndoForbiddenProto("1_Carpenter_Workshop");
UndoForbiddenProto("2_Blacksmith_Workshop");
UndoForbiddenProto("3_Mecanician_Workshop");
UndoForbiddenProto("4_Mason_Workshop");
UndoForbiddenProto("5_Architect_Workshop");
UndoForbiddenProto("6_Ingeneer_Workshop");
}
}
//==============================================================================
//==============================================================================
s32 Check_Invasion()
{
if(delaimodif==1)
{
delai=delai-840;
delaimodif=0;
}
if(voleurs_sarasins_Dead == 1)
{
StopFunction("Check_Invasion");
}
else
{
if ((GetPopulationAndSoldiers()>=50) && (GetTreasure()>=(goldviking+5000)))
{
s32 Answer;
replacetxtinnextmsg ("PROPOSITION_INVASION",goldviking);
Answer = AskPlayerYesNo("ARMY_INVASION_PREPAREINVASION");
if (Answer == 1)
{
AddGold(-goldviking);
Army_Reinforcement("desert_voleurs_sarasins",1.2,2.0); //multiplieur, multi MAXIMUM
goldviking=goldviking+500;
}
else
{
Army_StartInvasion("desert_voleurs_sarasins");
delai=delai+840;
delaimodif=1;
}
}
ExecInFewSecNoBattle("Check_Invasion", delai);
}
}
//==============================================================================
//==============================================================================
s32 Seuil()
{
if(fief_sarasins_Dead == 1)
{
StopFunction("Seuil");
}
else
{
if(pop_seuil >= seuil_max)
{
StopFunction("Seuil");
}
else
{
if(GetPopulationAndSoldiers() >= pop_seuil)
{
Attack();
pop_seuil = pop_seuil + 150;
}
}
}
}
//---------------
s32 Attack()
{
Choix = Random(2);
if(Message_avertissement==0)
{
MessageUserPause("DESERTATTAK_INVASION");
Message_avertissement = 1;
}
if(Choix == 0)
{
Army_StartInvasion("desert_mercenaires01_sarasins");
Army_Reinforcement("desert_mercenaires01_sarasins",1.2,2.0);
}
else
{
Army_StartInvasion("desert_mercenaires02_sarasins");
Army_Reinforcement("desert_mercenaires02_sarasins",1.2,2.0);
}
}
//==============================================================================
//==============================================================================
s32 CreateEnemies()
{
// Create Brigands "nom brigand",troop_attack,men_attack,toop_def,men_def,"model",facteur augmentation, attackdelay,defdelay
// Create Brigands "nom brigand", troop_attack, men_attack, troop_def, men_def, troop_inva, men_inva, "model", facteur augmentation, attackdelay, defdelay, Gold, Food
CreateBrigand( "desert_B1", 4, 6, 6, 8, 4, 6, "THIEVES", 0.5, 25, 30, 300, 300);
Army_SetDistanceTreveDeDieu("desert_B1", 40.0); // en metres.
Army_SetTextureFace("desert_B1", "ENNEMI_HEAD_07");
CreateBrigand( "desert_B2", 4, 6, 6, 8, 4, 6, "THIEVES", 0.5, 25, 30, 300, 300);
Army_SetDistanceTreveDeDieu("desert_B2", 50.0); // en metres.
Army_SetTextureFace("desert_B2", "ENNEMI_HEAD_04");
// CreateVillage "nom du village" "model" temps de preparation, Gold, Food
CreateVillage( "desert_V1", "SARRASIN", 30, 2000, 300);
Army_SetDistanceTreveDeDieu("desert_V1", 30.0); // en metres.
Army_SetTextureFace("desert_V1", "ENNEMI_HEAD_09");
CreateVillage( "desert_V2", "SARRASIN", 50, 600, 1200);
Army_SetDistanceTreveDeDieu("desert_V2", 40.0); // en metres.
Army_SetTextureFace("desert_V2", "ENNEMI_HEAD_10");
CreateVillage( "desert_V3", "SARRASIN", 30, 1000, 800);
Army_SetDistanceTreveDeDieu("desert_V3", 50.0); // en metres.
Army_SetTextureFace("desert_V3", "ENNEMI_HEAD_10");
// Createfief "nom fief", troop_attack, men_attack, troop_def, men_def, troop_invasion, men_invasion, model, augmentation, atackdelay, defdelay, invasiondelay, Gold Food
Createfief( "fief_sarasins", 8, 8, 12, 12, 10, 12, "SARRASIN", 1.0, 15, 120, 140, 1200, 800 );
Army_SetDistanceTreveDeDieu("fief_sarasins", 55.0); // en metres.
Army_SetTextureFace("fief_sarasins", "ENNEMI_HEAD_10");
// CreateInvasion( "nom invasion", troop_attack, men_attack, troop_invasion, men_invasion , "model", atackdelay, invasiondelay)
CreateInvasion( "desert_mercenaires01_sarasins", 8, 12, 10, 8, "SARRASIN_RIDER", 5, 10);
Army_SetTextureFace("desert_mercenaires01_sarasins", "ENNEMI_HEAD_10");
// CreateInvasion( "nom invasion", troop_attack, men_attack, troop_invasion, men_invasion , "model", atackdelay, invasiondelay)
CreateInvasion( "desert_mercenaires02_sarasins", 8, 12, 10, 8, "SARRASIN_RIDER", 5, 10);
Army_SetTextureFace("desert_mercenaires02_sarasins", "ENNEMI_HEAD_10");
// CreateInvasion( "nom invasion", troop_attack, men_attack, troop_invasion, men_invasion , "model", atackdelay, invasiondelay)
CreateInvasion( "desert_voleurs_sarasins", 8, 8, 8, 8, "SARRASIN_RIDER", 5, 10);
Army_SetTextureFace("desert_voleurs_sarasins", "ENNEMI_HEAD_09");
}
//==============================================================================
//==============================================================================