Changed some things around on Dragonify, hopefully resolving #50

This commit is contained in:
Deukhoofd 2016-03-03 20:45:42 +01:00
parent 5c5617ce99
commit 53bc6677d4
3 changed files with 7 additions and 3 deletions

View File

@ -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', ->

View File

@ -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

View File

@ -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) ->