Skip to content
Browse files

Do random research in semperfi js, add framework for template design

  • Loading branch information...
1 parent f993207 commit 2a7ec114838da2dbbf24254a5826ac30dcbe582b @perim perim committed Dec 27, 2011
Showing with 21 additions and 2 deletions.
  1. +21 −2 data/base/multiplay/skirmish/semperfi.js
View
23 data/base/multiplay/skirmish/semperfi.js
@@ -143,11 +143,20 @@ function eventResearched(labparam)
}
else
{
- pursueResearch(lab, reslist[0].name); // doing first for now, TODO use random
+ var idx = Math.floor(Math.random() * reslist.length);
+ pursueResearch(lab, reslist[idx].name);
}
}
}
}
+ if (!newTemplate("Constructor", "Body1REC", "wheeled01", "", "Spade1Mk1"))
+ {
+ debug("Failed to design truck");
+ }
+ if (!newTemplate("Viper", "Body1REC", "wheeled01", "", "MG1Mk1"))
+ {
+ debug("Failed to design viper");
+ }
}
function buildFundamentals()
@@ -170,11 +179,21 @@ function buildFundamentals()
// --- game events
+function eventDroidBuilt(droid, struct)
+{
+ var templ = getTemplate("Viper");
+ if (templ && structureIdle(struct))
+ {
+ debug("building Viper");
+ buildDroid("Viper", struct);
+ }
+}
+
function eventGameInit()
{
}
-function eventStructureAttacked(hitStruct, attackerObj)
+function eventStructureAttacked(struct, attacker)
{
}

0 comments on commit 2a7ec11

Please sign in to comment.
Something went wrong with that request. Please try again.