Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ...
  2.  
  3. const API = {
  4. hit(character, target) {
  5. // create a 'punch' or 'kick' and its impact,
  6. // based on character's attribute
  7. const attack = new CharacterAttack(character)
  8.  
  9. const damage = character.createDamage(attack, target)
  10. ...
  11. }
  12.  
  13. castSpell(character, magic, target) {
  14. const attack = MagicRepo.find(magic)
  15.  
  16. const damage = character.createDamage(attack, target)
  17. ...
  18. }
  19.  
  20. attack(character, target) {
  21. const { attack } = character.getWeapon()
  22.  
  23. const damage = character.createDamage(attack, target)
  24. ...
  25. }
  26.  
  27. ...
  28. }
  29.  
  30. export default API
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement