public static void delayedupdate() { int delaydelta = delay++ % 100; if (delaydelta == 1) { ScriptingCore.OnEvent("update"); } if (delaydelta == 10) { onchange(); } if (delaydelta == 20) { newday(); } if (delaydelta == 30) { noon(); } }
public static bool SetResearchCost(string research, string costtype, float costamount) { if (Db.Get().Techs.resources == null) { return(false); } foreach (Tech techtoadd in Db.Get().Techs.resources) { if (techtoadd.Id == research) { var res = Research.Instance.Get(techtoadd); if (res.tech.costsByResearchTypeID.ContainsKey(costtype)) { res.tech.costsByResearchTypeID[costtype] = costamount; } return(true); } } ScriptingCore.DebugLogError("SetResearchCost did not find: " + research); return(false); }
public static bool AddResearch(string research) { foreach (Tech techtoadd in Db.Get().Techs.resources) { if (techtoadd.Id == research) { var res = Research.Instance.Get(techtoadd); var req = Research.Instance.Get(techtoadd).tech.requiredTech; foreach (var i in req) { AddResearch(i.Id); } if (res == null) { ScriptingCore.DebugLogError("AddResearch did not find: " + research); return(false); } res.Purchased(); return(true); } } ScriptingCore.DebugLogError("AddResearch did not find: " + research); return(false); }
void start() { var scriptingcore = new ScriptingCore(); }
public static void Postfix() { ScriptingCore.OnEvent("update"); }
public static void Postfix() { ScriptingCore.OnEvent("maploaded"); }
public static void onchangegame() { ScriptingCore.OnEvent("onchangegame"); }
public static void Prefix() { ScriptingCore.OnEvent("directupdate"); delayedupdate(); }
public static void Prefix() { ScriptingCore.OnEvent("newgame"); }
public static void Postfix() { ScriptingCore.DebugLog("loadbuildings"); ScriptingCore.OnEvent("loadbuildings"); }
public static void Prefix() { ScriptingCore.ScriptInit(); ScriptingCore.DebugLog("preloadbuildings"); ScriptingCore.OnEvent("preloadbuildings"); }