Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/tutorials/introductory_tutorial.js
Trigger.prototype.tutorialGoals = [ | Trigger.prototype.tutorialGoals = [ | ||||
{ | { | ||||
"instructions": markForTranslation("Welcome to the 0 A.D. tutorial."), | "instructions": markForTranslation("Welcome to the 0 A.D. tutorial."), | ||||
}, | }, | ||||
{ | { | ||||
"instructions": markForTranslation("Left-click on a female citizen and then right-click on a berry bush to make that female citizen gather food. Female citizens gather vegetables faster than other units."), | "instructions": markForTranslation("Left-click on a female citizen and then right-click on a berry bush to make that female citizen gather food. Female citizens gather vegetables faster than other units."), | ||||
"OnPlayerCommand": function(msg) | "OnPlayerCommand": function(msg) | ||||
{ | { | ||||
let cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager); | |||||
cmpEndGameManager.MarkPlayerAndAlliesAsWon(1, () => "", () => ""); | |||||
this.NextGoal(); | |||||
Stan: Shouldn't forget to remove this; | |||||
if (msg.cmd.type == "gather" && msg.cmd.target && | if (msg.cmd.type == "gather" && msg.cmd.target && | ||||
TriggerHelper.GetResourceType(msg.cmd.target).specific == "fruit") | TriggerHelper.GetResourceType(msg.cmd.target).specific == "fruit") | ||||
this.NextGoal(); | this.NextGoal(); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"instructions": markForTranslation("Select the citizen-soldier, right-click on a tree near the Civic Center to begin gathering Wood. Citizen Soldiers gather Wood faster than female citizens."), | "instructions": markForTranslation("Select the citizen-soldier, right-click on a tree near the Civic Center to begin gathering Wood. Citizen Soldiers gather Wood faster than female citizens."), | ||||
"OnPlayerCommand": function(msg) | "OnPlayerCommand": function(msg) | ||||
▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | for (let ent of champions) | ||||
let cmpHealth = Engine.QueryInterface(ent, IID_Health); | let cmpHealth = Engine.QueryInterface(ent, IID_Health); | ||||
if (!cmpHealth) | if (!cmpHealth) | ||||
Engine.DestroyEntity(ent); | Engine.DestroyEntity(ent); | ||||
else if (--keep < 0) | else if (--keep < 0) | ||||
cmpHealth.Kill(); | cmpHealth.Kill(); | ||||
} | } | ||||
}; | }; | ||||
Trigger.prototype.OnCampaignGameEnd = function() | |||||
{ | |||||
return { | |||||
"somearbitrarydata": 4 | |||||
}; | |||||
}; | |||||
{ | { | ||||
let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); | let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); | ||||
cmpTrigger.playerID = 1; | cmpTrigger.playerID = 1; | ||||
cmpTrigger.enemyID = 2; | cmpTrigger.enemyID = 2; | ||||
cmpTrigger.RegisterTrigger("OnInitGame", "InitTutorial", { "enabled": true }); | cmpTrigger.RegisterTrigger("OnInitGame", "InitTutorial", { "enabled": true }); | ||||
} | } |
Wildfire Games · Phabricator
Shouldn't forget to remove this;