diff --git a/server/bw/data/moves.coffee b/server/bw/data/moves.coffee index e5241d6..5ad6571 100644 --- a/server/bw/data/moves.coffee +++ b/server/bw/data/moves.coffee @@ -492,7 +492,7 @@ extendMove 'Camouflage', -> @use = (battle, user, target) -> # Camouflage changes type based on terrain # In Wi-Fi battles, the terrain always results in Ground type. - target.types = [ "Ground" ] + target.types = [ "Normal" ] battle.message "#{user.name} transformed into a Ground type!" extendMove 'Captivate', -> diff --git a/server/bw/pokemon.coffee b/server/bw/pokemon.coffee index e923e47..044dd7a 100644 --- a/server/bw/pokemon.coffee +++ b/server/bw/pokemon.coffee @@ -132,6 +132,9 @@ class @Pokemon for move in @moves @ppHash[move.name] = @maxPPHash[move.name] = pp || (move.pp * 8/5) + setType: (newType) -> + @types = newType + # Gets the stat indexed by key. # Ex: pokemon.stat('hp') # TODO: Precalculate the stats in the constructor diff --git a/server/in/data/moves.coffee b/server/in/data/moves.coffee index 91a1515..5247cec 100644 --- a/server/in/data/moves.coffee +++ b/server/in/data/moves.coffee @@ -121,10 +121,11 @@ extendMove 'Freeze Shock', -> extendMove 'Dragonify', -> @afterSuccessfulHit = (battle, user, target) -> - if (target.types.length == 1 && target.types[0] == 'Dragon') || target.ability.displayName != 'Multitype' + console.log(target.types) + if (target.types.length is 1 and target.types[0] is "Dragon") or target.hasAbility('Multitype') == true @fail(battle, user) else - target.types = [ 'Dragon' ] + target.setType(["Dragon"]) battle.cannedText('TRANSFORM_TYPE', target, 'Dragon') makeOpponentFieldMove 'Livewire', (battle, user, opponentId) ->