Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var debug = false;
- enum itemType { thrown, oneHanded, twoHanded, polearm, firearm, bow, xbow, headArmour, bodyArmour, legArmour, handArmour, horse, shield, ammo, misc };
- enum dmgType { blunt, cut, pierce, pure, magic };
- enum att { str, agi, _int, cha };
- var itemList = Array(
- //Thrown wpn item Id itemName mesh defaultPrice projectileSize weight(kg) itemType atacks dmg dmgType. dmg speed blank blank blank
- Array( "stone", "Stone", "stoneMeshItem", 1, 4.5, 0.425, itemType.thrown, Array( Array( dmgType.blunt, 8, 85), 0, 0, 0) ),
- Array( "potato", "Potato", "potatoMeshItem", 15, 4.5, 0.225, itemType.thrown, Array( Array( dmgType.blunt, 5, 100), 0, 0, 0) ),
- //Melee wpn item Id itemName mesh defaultPrice range(cm) weight(kg) itemType atacks Up dmgType. dmg speed Down dmgType. dmg speed Left dmgType. dmg speed Right dmgType. dmg speed
- Array( "swordGoodA", "Knightly Sword", "swordMeshA", 3725, 102, 1.133, itemType.oneHanded, Array( Array( dmgType.cut, 35, 150), Array( dmgType.pierce, 25, 110), Array( dmgType.cut, 30, 130), Array( dmgType.cut, 30, 130)) ),
- Array( "pitchforkA", "Pitchfork", "pitchforkMeshA", 350, 190, 2.5, itemType.polearm, Array( Array( dmgType.blunt, 15, 50), Array( dmgType.pierce, 15, 70), 0, 0) ),
- Array( "scytheA", "Scythe", "scytheMeshA", 470, 230, 3.225, itemType.polearm, Array( Array( dmgType.cut, 20, 55), Array( dmgType.pierce, 25, 25), Array( dmgType.cut, 30, 50), Array( dmgType.cut, 30, 50)) ),
- //Armours item Id itemName mesh defaultPrice range(cm) weight(kg) itemType defense Forearm + Hand phisical magical fall Head phisical magical fall Body phisical magical fall Legs phisical magical fall
- Array( "crownA", "Crown", "crownA", 7500, 5, 3.5, itemType.headArmour,Array( Array( 15, 0, 0), Array( 15, 0, 0), Array( 15, 0, 0), Array( 15, 0, 0)) ),
- //Misc item Id itemName mesh defaultPrice size(cm) weight(kg) itemType BLANK blank blank blank blank
- Array( "coinGold", "Gold Coin", "coinGold", 1000, 5, 0.1, itemType.misc, Array( 0, 0, 0, 0) ),
- Array( "coinSilver", "Silver Coin", "coinSilver", 100, 4, 0.75, itemType.misc, Array( 0, 0, 0, 0) ),
- Array( "coinCopper", "Copper Coin", "coinCopper", 10, 2.5, 0.05, itemType.misc, Array( 0, 0, 0, 0) ),
- Array( "coinSmall", "Small Coin", "coinSmall", 1, 1, 0.01, itemType.misc, Array( 0, 0, 0, 0) )
- );
- // troop Id troopName namePlural stats inventory itemID quantity
- var troopList = Array(
- Array( "peasant1", "Peasant", "Peasants", Array(Array(att.str, 13),Array(att.agi, 13),Array(att._int, 13),Array(att.cha, 13)),
- Array(Array("potato",15), Array("pitchforkA", 1), Array("coinSmall", 10)) ),
- Array( "peasant2", "Peasant", "Peasants", Array(Array(att.str, 17),Array(att.agi, 17),Array(att._int, 17),Array(att.cha, 17)),
- Array(Array("stone", 5), Array("scytheA", 1), Array("coinSmall", 15)) ),
- Array( "lord1", "King", "The King", Array(Array(att.str, 30),Array(att.agi, 30),Array(att._int, 30),Array(att.cha, 30)),
- Array(Array("crownA",1), Array("swordGoodA", 1), Array("coinGold", 150)))
- );
- // i.e: Item("potato"); will return the array in itemList which has "potato" as the ID
- function Item ( itemID ) {
- var theItem = -1;
- var i = 0;
- while (i < itemList.length);
- {
- if (theItem == -1 && itemList[i][0] == itemID)
- {
- theItem = itemList[i];
- }
- i++;
- }
- return(theItem);
- }
- // i.e: Troop("peasant1"); will return the array in troopList which has "peasant1" as the ID
- function Troop ( troopID ) {
- var theTroop = -1;
- var i = 0;
- while (i < troopList.length);
- {
- if (theTroop == -1 && troopList[i][0] == troopID)
- {
- theTroop = troopList[i];
- }
- i++;
- }
- return(theTroop);
- }
- function Start () {
- }
- function Update () {
- var troop = Troop(
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement