Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var buildCost = 0;
  2.  
  3. for(var bodypart in cfg.body){
  4. switch(bodypart){
  5. case "MOVE":
  6. case "CARRY":
  7. buildCost+=50;
  8. break;
  9. case "WORK":
  10. buildCost+=20;
  11. break;
  12. case "HEAL":
  13. buildCost+=200;
  14. break;
  15. case "TOUGH":
  16. buildCost+=5;
  17. break;
  18. case "ATTACK":
  19. buildCost+=100;
  20. break;
  21. case "RANGED_ATTACK":
  22. buildCost+=150;
  23. break;
  24. }
  25. console.log(bodypart+" costs "+buildCost);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement