1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-29 02:30:05 +00:00

Gotta git gud

This commit is contained in:
Deukhoofd
2016-02-20 00:54:42 +01:00
parent 19558607f3
commit 1114909caf
32 changed files with 401 additions and 121 deletions

View File

@@ -45,7 +45,7 @@ class @Pokemon extends Backbone.Model
@set('ivs', ivs, silent: true)
@set('ability', @getAbilities()[0]) unless attributes.ability
@set('level', 100) unless attributes.level
@set('level', @getGeneration.maxLevel) unless attributes.level
@set('happiness', 100) if isNaN(attributes.happiness)
@set('nature', 'Hardy') unless attributes.nature
hiddenPowerType = HiddenPower.BW.type(@get('ivs')).toLowerCase()
@@ -66,7 +66,6 @@ class @Pokemon extends Backbone.Model
speed: 0
accuracy: 0
evasion: 0
normalizeStats: (hash, defaultValue) ->
stats = [ "hp", "attack", "defense", "specialAttack",
"specialDefense", "speed"]
@@ -180,7 +179,7 @@ class @Pokemon extends Backbone.Model
stat: (key) ->
base = @base(key)
return 1 if base == 1 # For Shedinja. key doesn't have to be hp.
level = @get('level') || 100
level = @get('level') || @getGeneration.maxLevel
iv = @iv(key)
ev = Math.floor(@ev(key) / 4)
total = if key == 'hp'