itajaja / hb

a dungeon crawler written in TypeScript using React and svg
http://giacomotag.io/hb/
MIT License
69 stars 28 forks source link

Change the setting of unit #3

Closed ValleyInforge closed 7 years ago

ValleyInforge commented 7 years ago

Hello,

I would change the stat of the unit, like "mp", "hp", "mana", ecc. I need to modify the archer.ts (for example) and after do the build? I tried without success.

import { meleeAttack } from '../actions/meleeAttack'
import { rangedAttack } from '../actions/rangedAttack'
import { IUnitType } from '../unit'

export default {
  name: 'Archer',
  description: 'The archer is able to bring despair upon his enemies ' +
    'while they are still out of sight. He travels lightly, and he prefers ' +
    'to stay away from the heart of the battle.',

  hp: 18,
  mp: 13,
  mana: 0,
  resistance: 0,
  actions: [
    meleeAttack({ damage: 4 }),
    rangedAttack({ damage: 6, range: [6, 2] }),
  ],

  cost: 18,
} as IUnitType
itajaja commented 7 years ago

there are two strategies, you can run npm run start, and then when you modify the code, the code will auto reload with the freshest version, or you can modify the code and then run npm run build again

ValleyInforge commented 7 years ago

Thanks, it work!