Advertisement
Guest User

test

a guest
Nov 22nd, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var debug = false;
  2.  
  3. enum itemType   { thrown, oneHanded, twoHanded, polearm, firearm, bow, xbow, headArmour, bodyArmour, legArmour, handArmour, horse, shield, ammo, misc };
  4. enum dmgType    { blunt, cut, pierce, pure, magic };
  5. enum att        { str, agi, _int, cha };
  6.  
  7. var itemList =  Array(
  8. //Thrown wpn        item    Id              itemName            mesh                defaultPrice    projectileSize  weight(kg)  itemType            atacks  dmg             dmgType.        dmg     speed   blank                                   blank                                   blank                          
  9.                     Array(  "stone",        "Stone",            "stoneMeshItem",    1,              4.5,            0.425,      itemType.thrown,    Array(  Array(          dmgType.blunt,  8,      85),    0,                                      0,                                      0)                                  ),
  10.                     Array(  "potato",       "Potato",           "potatoMeshItem",   15,             4.5,            0.225,      itemType.thrown,    Array(  Array(          dmgType.blunt,  5,      100),   0,                                      0,                                      0)                                  ),
  11. //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
  12.                     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))   ),
  13.                     Array(  "pitchforkA",   "Pitchfork",        "pitchforkMeshA",   350,            190,            2.5,        itemType.polearm,   Array(  Array(          dmgType.blunt,  15,     50),    Array(  dmgType.pierce, 15,     70),    0,                                      0)                                  ),
  14.                     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))    ),
  15. //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   
  16.                     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)) ),
  17. //Misc              item    Id              itemName            mesh                defaultPrice    size(cm)        weight(kg)  itemType            BLANK   blank                                           blank                                   blank                                   blank                          
  18.                     Array(  "coinGold",     "Gold Coin",        "coinGold",         1000,           5,              0.1,        itemType.misc,      Array(  0,                                              0,                                      0,                                      0)                                  ),
  19.                     Array(  "coinSilver",   "Silver Coin",      "coinSilver",       100,            4,              0.75,       itemType.misc,      Array(  0,                                              0,                                      0,                                      0)                                  ),
  20.                     Array(  "coinCopper",   "Copper Coin",      "coinCopper",       10,             2.5,            0.05,       itemType.misc,      Array(  0,                                              0,                                      0,                                      0)                                  ),
  21.                     Array(  "coinSmall",    "Small Coin",       "coinSmall",        1,              1,              0.01,       itemType.misc,      Array(  0,                                              0,                                      0,                                      0)                                  )
  22.                     );
  23. //              troop   Id              troopName   namePlural      stats           inventory   itemID  quantity
  24. var troopList = Array(
  25.                     Array(  "peasant1",     "Peasant",  "Peasants",     Array(Array(att.str, 13),Array(att.agi, 13),Array(att._int, 13),Array(att.cha, 13)),
  26.                         Array(Array("potato",15),       Array("pitchforkA", 1), Array("coinSmall",  10)) ),
  27.                     Array(  "peasant2",     "Peasant",  "Peasants",     Array(Array(att.str, 17),Array(att.agi, 17),Array(att._int, 17),Array(att.cha, 17)),
  28.                         Array(Array("stone",    5),     Array("scytheA",    1), Array("coinSmall",  15)) ),
  29.                     Array(  "lord1",        "King",     "The King",     Array(Array(att.str, 30),Array(att.agi, 30),Array(att._int, 30),Array(att.cha, 30)),
  30.                         Array(Array("crownA",1),        Array("swordGoodA", 1), Array("coinGold",   150)))
  31.                     );
  32.  
  33. // i.e: Item("potato"); will return the array in itemList which has "potato" as the ID
  34. function Item ( itemID ) {
  35.     var theItem = -1;
  36.     var i = 0;
  37.     while (i < itemList.length);
  38.     {
  39.         if (theItem == -1 && itemList[i][0] == itemID)
  40.         {
  41.             theItem     = itemList[i];
  42.         }
  43.         i++;
  44.     }
  45.     return(theItem);
  46. }
  47.  
  48. // i.e: Troop("peasant1"); will return the array in troopList which has "peasant1" as the ID
  49. function Troop ( troopID ) {
  50.     var theTroop    = -1;
  51.     var i = 0;
  52.     while (i < troopList.length);
  53.     {
  54.         if (theTroop == -1 && troopList[i][0] == troopID)
  55.         {
  56.             theTroop        = troopList[i];
  57.         }
  58.         i++;
  59.     }
  60.     return(theTroop);
  61. }
  62.  
  63. function Start () {
  64.  
  65. }
  66.  
  67. function Update () {
  68.     var troop = Troop(
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement