mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2025-10-27 18:00:03 +00:00
Made Primal Evolution objects limit a condition
This commit is contained in:
@@ -321,10 +321,11 @@ class @Battle extends Room
|
||||
|
||||
# Passing -1 to turns makes the weather last forever.
|
||||
setWeather: (weatherName, turns=-1) ->
|
||||
console.log(weatherName)
|
||||
console.log(@weakWeather)
|
||||
if weatherName in @weakWeather and @weather in @strongWeather
|
||||
@cannedText("WEATHER_FAIL")
|
||||
switch @weather
|
||||
when Weather.DELTASTREAM then "WEATHER_FAIL_AIR"
|
||||
when Weather.HARSHSUN then "WEATHER_FAIL_SUN"
|
||||
when Weather.HEAVYRAIN then "WEATHER_FAIL_RAIN"
|
||||
return
|
||||
cannedText = switch weatherName
|
||||
when Weather.SUN then "SUN_START"
|
||||
|
||||
@@ -131,6 +131,17 @@ createCondition Conditions.EVASION_CLAUSE,
|
||||
|
||||
return errors
|
||||
|
||||
createCondition Conditions.PRIMAL_LIMIT,
|
||||
validateTeam: (team, genData) ->
|
||||
errors = []
|
||||
items = team.map((p) -> p.item)
|
||||
primalitems = ["Red Orb", "Blue Orb"]
|
||||
i = 0
|
||||
for item in items
|
||||
i++ if item in primalitems
|
||||
errors.push("You can only have one Primal Evolution item in your team") if i > 1
|
||||
return errors
|
||||
|
||||
createCondition Conditions.OHKO_CLAUSE,
|
||||
validatePokemon: (pokemon, genData, prefix) ->
|
||||
{moves} = pokemon
|
||||
|
||||
@@ -13,7 +13,7 @@ eval(coffee.compile(require('fs').readFileSync(path, 'utf8'), bare: true))
|
||||
[ species, forme ] = @item.mega
|
||||
return false if @species != species || @forme != 'default'
|
||||
return false if @team.hasMegaEvolved and forme is "mega"
|
||||
return false if @team.hasPrimalEvolved and forme is "primal"
|
||||
#return false if @team.hasPrimalEvolved and forme is "primal"
|
||||
return true
|
||||
|
||||
oldBlockSwitch = @Pokemon::blockSwitch
|
||||
|
||||
Reference in New Issue
Block a user