Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- const API = {
- hit(character, target) {
- // create a 'punch' or 'kick' and its impact,
- // based on character's attribute
- const attack = new CharacterAttack(character)
- const damage = character.createDamage(attack, target)
- ...
- }
- castSpell(character, magic, target) {
- const attack = MagicRepo.find(magic)
- const damage = character.createDamage(attack, target)
- ...
- }
- attack(character, target) {
- const { attack } = character.getWeapon()
- const damage = character.createDamage(attack, target)
- ...
- }
- ...
- }
- export default API
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement