mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2025-10-28 02:00:04 +00:00
Gotta git gud
This commit is contained in:
@@ -141,17 +141,31 @@ class @Battle extends Room
|
||||
@emit('beforeStart')
|
||||
else
|
||||
for id in @playerIds
|
||||
console.log(id)
|
||||
team = @teams[id]
|
||||
allpokemon = team.all()
|
||||
for pokemon in allpokemon
|
||||
if pokemon.hasAbility('Illusion')
|
||||
alivemons = team.getAlivePokemon()
|
||||
lastalivemon = alivemons[alivemons.length-1]
|
||||
pokemon.attach(Attachment.Illusion, lastalivemon)
|
||||
pokemon.attach(Attachment.Illusion, lastalivemon)
|
||||
@startBattle()
|
||||
|
||||
startBattle: ->
|
||||
@emit('start')
|
||||
for playerId in @playerIds
|
||||
team = @teams[playerId]
|
||||
allpokemon = team.all()
|
||||
for pokemon in allpokemon
|
||||
if pokemon.getForme().isItemBased
|
||||
[ species, forme ] = pokemon.item.itemForme
|
||||
if pokemon.species != species
|
||||
pokemon.changeForme("default")
|
||||
if typeof pokemon.item != 'undefined' and typeof pokemon.item.itemForme != 'undefined'
|
||||
[ species, forme ] = pokemon.item.itemForme
|
||||
if species is pokemon.species
|
||||
pokemon.changeForme(forme)
|
||||
|
||||
@tell(Protocol.START_BATTLE)
|
||||
# TODO: Merge this with performReplacements?
|
||||
for playerId in @playerIds
|
||||
|
||||
@@ -275,7 +275,6 @@ makePinchBerry 'Custap Berry', 'afterTurnOrder', (battle, eater) ->
|
||||
battle.bump(eater)
|
||||
|
||||
makeWeatherItem 'Damp Rock', Weather.RAIN
|
||||
makeWeatherItem 'Dark Rock', Weather.MOON
|
||||
makeGemItem 'Dark Gem', 'Dark'
|
||||
makeTypeBoostItem 'Dragon Fang', 'Dragon'
|
||||
makeGemItem 'Dragon Gem', 'Dragon'
|
||||
|
||||
@@ -18,7 +18,7 @@ class @Pokemon
|
||||
@species = attributes.species || "Missingno"
|
||||
@name = attributes.name || @species
|
||||
@forme = attributes.forme || "default"
|
||||
@level = attributes.level || 120
|
||||
@level = attributes.level || @getMaxLevel()
|
||||
@gender = attributes.gender || "Genderless"
|
||||
@shiny = attributes.shiny
|
||||
@nfe = (SpeciesData[@species]?.evolvesInto?.length > 0)
|
||||
@@ -88,6 +88,10 @@ class @Pokemon
|
||||
@resetForme()
|
||||
return true
|
||||
|
||||
getMaxLevel: ->
|
||||
level = 100
|
||||
level
|
||||
|
||||
resetForme: ->
|
||||
forme = @getForme() || {}
|
||||
@baseStats = _.clone(forme.stats) || {}
|
||||
@@ -533,6 +537,7 @@ class @Pokemon
|
||||
shouldBlockExecution: (move, user) ->
|
||||
Query.untilTrue('shouldBlockExecution', @attachments.all(), move, user)
|
||||
|
||||
|
||||
update: ->
|
||||
Query('update', @attachments.all())
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ class @Team
|
||||
@faintedLastTurn = false
|
||||
@faintedThisTurn = false
|
||||
|
||||
hasMegaEvolved = false
|
||||
hasPrimalEvolved = false
|
||||
|
||||
arrange: (arrangement) ->
|
||||
@pokemon = (@pokemon[index] for index in arrangement)
|
||||
|
||||
@@ -45,6 +48,11 @@ class @Team
|
||||
get: (attachmentName) ->
|
||||
@attachments.get(attachmentName)
|
||||
|
||||
megaEvolve: ->
|
||||
@hasMegaEvolved = true
|
||||
primalEvolve: ->
|
||||
@hasPrimalEvolved = true
|
||||
|
||||
attach: (attachment, options={}) ->
|
||||
options = _.clone(options)
|
||||
attachment = @attachments.push(attachment, options, battle: @battle, team: this)
|
||||
|
||||
Reference in New Issue
Block a user