home *** CD-ROM | disk | FTP | other *** search
- function findStats()
- {
- playerStats = {agi:40,def:0,att:0};
- itms = new Array();
- itms.push(_root.possibleWeapons[_root.playerActiveWeapon]);
- itms.push(_root.possibleShields[_root.playerActiveShield]);
- itms.push(_root.possibleHelmets[_root.playerActiveHelmet]);
- itms.push(_root.possibleArmours[_root.playerActiveArmour]);
- itms.push(_root.possibleArms[_root.playerActiveArms]);
- itms.push(_root.possibleBoots[_root.playerActiveBoots]);
- for(i in itms)
- {
- item = itms[i];
- if(item.attr.agi !== undefined)
- {
- playerStats.agi += item.attr.agi;
- }
- if(item.attr.att !== undefined)
- {
- playerStats.att += item.attr.att;
- }
- if(item.attr.def !== undefined)
- {
- playerStats.def += item.attr.def;
- }
- }
- stats = "att=" + playerStats.att + " def=" + playerStats.def + " agi=" + playerStats.agi;
- return playerStats;
- }
- function attachitem(item, num, type)
- {
- i = display.attachMovie("itemicon","itemicon" + items,items);
- i.gotoAndStop(type);
- i.icon.gotoAndStop(item.framename);
- i._x = items % 4 * 60 + 25;
- i._y = 25 + Math.floor(items / 4) * 60;
- items++;
- i.cost = item.cost;
- i.num = num;
- i.framename = item.framename;
- i.name = item.name;
- i.type = type;
- i.onRollOver = function()
- {
- itemname = this.name;
- };
- i.onRollOut = function()
- {
- itemname = "";
- };
- i.onRelease = function()
- {
- switch(this.type)
- {
- case "weapon":
- _root.playerActiveWeapon = this.num;
- weapon.icon.gotoAndStop(this.framename);
- break;
- case "helmet":
- _root.playerActiveHelmet = this.num;
- helmet.icon.gotoAndStop(this.framename);
- break;
- case "shield":
- _root.playerActiveShield = this.num;
- shield.icon.gotoAndStop(this.framename);
- break;
- case "boots":
- _root.playerActiveBoots = this.num;
- boots.icon.gotoAndStop(this.framename);
- break;
- case "armour":
- _root.playerActiveArmour = this.num;
- armour.icon.gotoAndStop(this.framename);
- break;
- case "arm":
- _root.playerActiveArms = this.num;
- arm.icon.gotoAndStop(this.framename);
- }
- findStats();
- };
- }
- findStats();
- stop();
- gp = "you have " + _root.playerMoney + "gp";
- items = 0;
- for(w in _root.playerWeapons)
- {
- weap = _root.possibleWeapons[_root.playerWeapons[w]];
- attachitem(weap,_root.playerWeapons[w],"weapon");
- }
- for(w in _root.playerShields)
- {
- weap = _root.possibleShields[_root.playerShields[w]];
- attachitem(weap,_root.playerShields[w],"shield");
- }
- for(w in _root.playerHelmets)
- {
- weap = _root.possibleHelmets[_root.playerHelmets[w]];
- attachitem(weap,_root.playerHelmets[w],"helmet");
- }
- for(w in _root.playerArmours)
- {
- weap = _root.possibleArmours[_root.playerArmours[w]];
- attachitem(weap,_root.playerArmours[w],"armour");
- }
- for(w in _root.playerArms)
- {
- weap = _root.possibleArms[_root.playerArms[w]];
- attachitem(weap,_root.playerArms[w],"arm");
- }
- for(w in _root.playerBoots)
- {
- weap = _root.possibleBoots[_root.playerBoots[w]];
- attachitem(weap,_root.playerBoots[w],"boots");
- }
-