Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var buildCost = 0;
- for(var bodypart in cfg.body){
- switch(bodypart){
- case "MOVE":
- case "CARRY":
- buildCost+=50;
- break;
- case "WORK":
- buildCost+=20;
- break;
- case "HEAL":
- buildCost+=200;
- break;
- case "TOUGH":
- buildCost+=5;
- break;
- case "ATTACK":
- buildCost+=100;
- break;
- case "RANGED_ATTACK":
- buildCost+=150;
- break;
- }
- console.log(bodypart+" costs "+buildCost);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement