Changed: PokemonEvolution --- Left +++ Right @@ -562,5 +562,5 @@ def pbCheckEvolutionEx(pokemon) - return -1 if pokemon.item==PBItems::EVERSTONE + return -1 if isConst?(pokemon.item,PBItems,:EVERSTONE) return -1 if pokemon.species<=0 || pokemon.egg? ret=-1 Changed: PBFile --- Left +++ Right @@ -6,5 +6,5 @@ ret=0 each_byte do |i| - ret=i + ret=i || 0 break end @@ -16,4 +16,5 @@ ret=0 each_byte do |i| + break if !i ret|=(i<1 @facebitmaptmp.update - @facebitmap.blt(0,0,@facebitmaptmp,Rect.new( + @facebitmap.blt(0,0,@facebitmaptmp.bitmap,Rect.new( (@faceIndex % 4) * 96, (@faceIndex / 4) * 96, 96, 96 @@ -1829,2 +1828,3 @@ end end + Changed: DrawText --- Left +++ Right @@ -277,5 +277,5 @@ text,lineheight,newlineBreaks=true, explicitBreaksOnly=false) - text2=text.gsub(/<(\/?)([Cc]|[Cc][2]|[Uu]|[Ss])(\s*\=\s*([^>]*))?>/,"") + text2=text.gsub(/<(\/?)([Cc]|[Cc][2]|[Cc][3]|[Oo]|[Uu]|[Ss])(\s*\=\s*([^>]*))?>/,"") if newlineBreaks text2.gsub!(/<(\/?)([Bb][Rr])(\s*\=\s*([^>]*))?>/,"\n") Changed: PokeBattle_Battler --- Left +++ Right @@ -362,5 +362,5 @@ speed=speed*2 end - if @item==PBItems::MACHOBRACE + if isConst?(@item,PBItems,:MACHOBRACE) speed=(speed/2).floor end @@ -589,6 +589,6 @@ end -def pbConfusionBerry(id,flavor,message1,message2) - if self.item==id && self.hp<=(self.totalhp/2).floor +def pbConfusionBerry(symbol,flavor,message1,message2) + if isConst?(self.item,PBItems,symbol) && self.hp<=(self.totalhp/2).floor pbRecoverHP((self.totalhp/8).floor) @battle.pbDisplay(message1) @@ -605,6 +605,6 @@ end end -def pbStatIncreasingBerry(id,stat,message) - if self.item==id && self.hp<=(self.totalhp/4).floor && !self.pbTooHigh?(stat) +def pbStatIncreasingBerry(symbol,stat,message) + if isConst?(self.item,PBItems,symbol) && self.hp<=(self.totalhp/4).floor && !self.pbTooHigh?(stat) @stages[stat]+=1 @battle.pbDisplay(message) @@ -617,5 +617,5 @@ return if hp<=0 itemname=(self.item==0) ? "" : PBItems.getName(self.item) - if hpcure && self.item==PBItems::BERRYJUICE && self.hp<=(self.totalhp/2).floor + if hpcure && isConst?(self.item,PBItems,:BERRYJUICE) && self.hp<=(self.totalhp/2).floor @battle.pbDisplay(_INTL("{1}'s {2} restored health!",pbThis,itemname)) self.pbRecoverHP(20) @@ -623,5 +623,5 @@ self.item=0 end - if hpcure && self.item==PBItems::ORANBERRY && self.hp<=(self.totalhp/2).floor + if hpcure && isConst?(self.item,PBItems,:ORANBERRY) && self.hp<=(self.totalhp/2).floor @battle.pbDisplay(_INTL("{1}'s {2} restored health!",pbThis,itemname)) self.pbRecoverHP(10) @@ -629,5 +629,5 @@ self.item=0 end - if hpcure && self.item==PBItems::SITRUSBERRY && self.hp<=(self.totalhp/2).floor + if hpcure && isConst?(self.item,PBItems,:SITRUSBERRY) && self.hp<=(self.totalhp/2).floor @battle.pbDisplay(_INTL("{1}'s {2} restored health!",pbThis,itemname)) self.pbRecoverHP(30) @@ -635,5 +635,5 @@ self.item=0 end - while self.item==PBItems::CHERIBERRY && status==PBStatuses::PARALYSIS + while isConst?(self.item,PBItems,:CHERIBERRY) && status==PBStatuses::PARALYSIS @battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis problem!",pbThis,itemname)) self.status=0 @@ -641,5 +641,5 @@ self.item=0 end - while self.item==PBItems::CHESTOBERRY && status==PBStatuses::SLEEP + while isConst?(self.item,PBItems,:CHESTOBERRY) && status==PBStatuses::SLEEP @battle.pbDisplay(_INTL("{1}'s {2} cured its sleep problem!",pbThis,itemname)) self.status=0 @@ -647,5 +647,5 @@ self.item=0 end - while self.item==PBItems::PECHABERRY && status==PBStatuses::POISON + while isConst?(self.item,PBItems,:PECHABERRY) && status==PBStatuses::POISON @battle.pbDisplay(_INTL("{1}'s {2} cured its poison problem!",pbThis,itemname)) self.status=0 @@ -653,5 +653,5 @@ self.item=0 end - while self.item==PBItems::RAWSTBERRY && status==PBStatuses::BURN + while isConst?(self.item,PBItems,:RAWSTBERRY) && status==PBStatuses::BURN @battle.pbDisplay(_INTL("{1}'s {2} cured its burn problem!",pbThis,itemname)) self.status=0 @@ -659,5 +659,5 @@ self.item=0 end - while self.item==PBItems::ASPEARBERRY && status==PBStatuses::FROZEN + while isConst?(self.item,PBItems,:ASPEARBERRY) && status==PBStatuses::FROZEN @battle.pbDisplay(_INTL("{1}'s {2} cured its ice problem!",pbThis,itemname)) self.status=0 @@ -665,5 +665,5 @@ self.item=0 end - if hpcure && self.item==PBItems::LEPPABERRY + if hpcure && isConst?(self.item,PBItems,:LEPPABERRY) for i in 0...@pokemon.moves.length pokemove=@pokemon.moves[i] @@ -681,5 +681,5 @@ end end - while self.item==PBItems::PERSIMBERRY && @effects[PBEffects::Confusion]>0 + while isConst?(self.item,PBItems,:PERSIMBERRY) && @effects[PBEffects::Confusion]>0 @battle.pbDisplay(_INTL("{1}'s {2} cured its confusion problem!",pbThis,itemname)) @effects[PBEffects::Confusion]=0 @@ -687,5 +687,5 @@ self.item=0 end - while self.item==PBItems::LUMBERRY && (status>0||@effects[PBEffects::Confusion]>0) + while isConst?(self.item,PBItems,:LUMBERRY) && (status>0||@effects[PBEffects::Confusion]>0) if @effects[PBEffects::Confusion]>0 @battle.pbDisplay(_INTL("{1}'s {2} cured its confusion problem!",pbThis,itemname)) @@ -710,31 +710,31 @@ end if hpcure - pbConfusionBerry(PBItems::FIGYBERRY,0, + pbConfusionBerry(:FIGYBERRY,0, _INTL("{1}'s {2} restored health!",pbThis,itemname), _INTL("For {1}, the {2} was too spicy!",pbThis,itemname)) - pbConfusionBerry(PBItems::WIKIBERRY,3, + pbConfusionBerry(:WIKIBERRY,3, _INTL("{1}'s {2} restored health!",pbThis,itemname), _INTL("For {1}, the {2} was too dry!",pbThis,itemname)) - pbConfusionBerry(PBItems::MAGOBERRY,2, + pbConfusionBerry(:MAGOBERRY,2, _INTL("{1}'s {2} restored health!",pbThis,itemname), _INTL("For {1}, the {2} was too sweet!",pbThis,itemname)) - pbConfusionBerry(PBItems::AGUAVBERRY,4, + pbConfusionBerry(:AGUAVBERRY,4, _INTL("{1}'s {2} restored health!",pbThis,itemname), _INTL("For {1}, the {2} was too bitter!",pbThis,itemname)) - pbConfusionBerry(PBItems::IAPAPABERRY,1, + pbConfusionBerry(:IAPAPABERRY,1, _INTL("{1}'s {2} restored health!",pbThis,itemname), _INTL("For {1}, the {2} was too sour!",pbThis,itemname)) - pbStatIncreasingBerry(PBItems::LIECHIBERRY,PBStats::ATTACK, + pbStatIncreasingBerry(:LIECHIBERRY,PBStats::ATTACK, _INTL("Using its {1}, the Attack of {2} rose!",itemname,pbThis)) - pbStatIncreasingBerry(PBItems::GANLONBERRY,PBStats::DEFENSE, + pbStatIncreasingBerry(:GANLONBERRY,PBStats::DEFENSE, _INTL("Using its {1}, the Defense of {2} rose!",itemname,pbThis)) - pbStatIncreasingBerry(PBItems::SALACBERRY,PBStats::SPEED, + pbStatIncreasingBerry(:SALACBERRY,PBStats::SPEED, _INTL("Using its {1}, the Speed of {2} rose!",itemname,pbThis)) - pbStatIncreasingBerry(PBItems::PETAYABERRY,PBStats::SPATK, + pbStatIncreasingBerry(:PETAYABERRY,PBStats::SPATK, _INTL("Using its {1}, the Special Attack of {2} rose!",itemname,pbThis)) - pbStatIncreasingBerry(PBItems::APICOTBERRY,PBStats::SPDEF, + pbStatIncreasingBerry(:APICOTBERRY,PBStats::SPDEF, _INTL("Using its {1}, the Special Defense of {2} rose!",itemname,pbThis)) end - if hpcure && self.item==PBItems::LANSATBERRY && self.hp<=(self.totalhp/4).floor && !@effects[PBEffects::FocusEnergy] + if hpcure && isConst?(self.item,PBItems,:LANSATBERRY) && self.hp<=(self.totalhp/4).floor && !@effects[PBEffects::FocusEnergy] @battle.pbDisplay(_INTL("{1} used its {2} to get pumped!",pbThis,itemname)) @effects[PBEffects::FocusEnergy]=true @@ -742,5 +742,5 @@ self.item=0 end - if hpcure && self.item==PBItems::STARFBERRY && self.hp<=(self.totalhp/4).floor + if hpcure && isConst?(self.item,PBItems,:STARFBERRY) && self.hp<=(self.totalhp/4).floor stats=[] messages=[ @@ -763,5 +763,5 @@ end end - if self.item==PBItems::WHITEHERB + if isConst?(self.item,PBItems,:WHITEHERB) while true reducedstats=0 @@ -778,5 +778,5 @@ end end - while self.item==PBItems::MENTALHERB && @effects[PBEffects::Attract]>=0 + while isConst?(self.item,PBItems,:MENTALHERB) && @effects[PBEffects::Attract]>=0 @battle.pbDisplay(_INTL("{1}'s {2} cured its love problem!",pbThis,itemname)) @effects[PBEffects::Attract]=-1 @@ -784,5 +784,5 @@ self.item=0 end - if hpcure && self.item==PBItems::LEFTOVERS && self.hp!=self.totalhp + if hpcure && isConst?(self.item,PBItems,:LEFTOVERS) && self.hp!=self.totalhp pbRecoverHP((self.totalhp/16).floor) @battle.pbDisplay(_INTL("{1}'s {2} restored its HP a little!",pbThis,itemname)) @@ -1248,5 +1248,5 @@ # thismove.pbAdditionalEffect2(user,target) # end - if user.item==PBItems::KINGSROCK&& + if isConst?(user.item,PBItems,:KINGSROCK)&& (thismove.flags&0x20)!=0 && @battle.pbRandom(10)==0 # flag f: King's Rock if target.ability!=PBAbilities::INNERFOCUS && target.effects[PBEffects::Substitute]==0 @@ -1293,5 +1293,5 @@ end # Shell Bell - if user.item==PBItems::SHELLBELL && damage > 0 && user.hp>0 + if isConst?(user.item,PBItems,:SHELLBELL) && damage > 0 && user.hp>0 hpgain=user.pbRecoverHP((damage/8).floor) if hpgain>0 @@ -1333,5 +1333,5 @@ end # Shell Bell - if user.item==PBItems::SHELLBELL && damage > 0 && user.hp>0 + if isConst?(user.item,PBItems,:SHELLBELL) && damage > 0 && user.hp>0 hpgain=user.pbRecoverHP((damage/8).floor) if hpgain>0 @@ -1373,5 +1373,5 @@ thismove.pbAdditionalEffect(user,target) end - if user.item==PBItems::KINGSROCK&& + if isConst?(user.item,PBItems,:KINGSROCK)&& (thismove.flags&0x20)!=0 && @battle.pbRandom(10)==0 # flag f: King's Rock if target.ability!=PBAbilities::INNERFOCUS && target.effects[PBEffects::Substitute]==0 @@ -1462,5 +1462,5 @@ numhits=thismove.pbNumHits target.damagestate.reset - if target.item==PBItems::FOCUSBAND && @battle.pbRandom(10)==0 #Works even if it's a Future Sight attack + if isConst?(target.item,PBItems,:FOCUSBAND) && @battle.pbRandom(10)==0 #Works even if it's a Future Sight attack target.damagestate.focusband=true end @@ -1520,5 +1520,6 @@ @effects[PBEffects::Conversion2Move]=0 @effects[PBEffects::Conversion2Type]=0 - if @effects[PBEffects::ChoiceBand]<0 && @lastMoveUsed>=0 && @hp>0 && @item==PBItems::CHOICEBAND + if @effects[PBEffects::ChoiceBand]<0 && @lastMoveUsed>=0 && @hp>0 && + isConst?(@item,PBItems,:CHOICEBAND) @effects[PBEffects::ChoiceBand]=@lastMoveUsed end Changed: PokemonBag --- Left +++ Right @@ -859,6 +859,8 @@ @items=[] # Start storage with a Potion - ItemStorageHelper.pbStoreItem( - @items,MAXSIZE,MAXPERSLOT,PBItems::POTION,1) + if hasConst?(PBItems,:POTION) + ItemStorageHelper.pbStoreItem( + @items,MAXSIZE,MAXPERSLOT,getConst(PBItems,:POTION),1) + end end def empty? Changed: PokeBattle_BattlePalace --- Left +++ Right @@ -87,5 +87,5 @@ end if thispkmn.effects[PBEffects::ChoiceBand]!=0 && thismove.id!=thispkmn.effects[PBEffects::ChoiceBand]&& - thispkmn.item.id==PBItems::CHOICEBAND + isConst?(thispkmn.item.id,PBItems,:CHOICEBAND) return false end Changed: PokemonUtilities --- Left +++ Right @@ -219,15 +219,16 @@ -def getRandomNameEx(type,variable,upper,*formats) -if formats.length==0 +def getRandomNameEx(type,variable,upper,maxLength=100) +formats=[] case type when 0 # Names for males - formats=%w( WE WE5 WEVE BVE BVE5 BVEVE ) + formats=%w( F5 BvE FE FE5 FEvE ) when 1 # Names for females - formats=%w( vE6 vEVE6 BVE6 B4 ) + formats=%w( vE6 vEvE6 BvE6 B4 v3 vEv3 Bv3 ) when 2 # Neutral gender names - formats=%w( WE WEU WEVE BVE BVEU BVEVE ) + formats=%w( WE WEU WEvE BvE BvEU BvEvE ) + else + return "" end -end format=formats[rand(formats.length)] name="" @@ -240,8 +241,4 @@ set=%w( a a a e e e i i i o o o u u u ) name+=set[rand(set.length)] - when "V" # vowel or vowel group - set=%w( a a a e e e i i i o o o u u u ai ai au au ay ay - ie ie ee ee uu uu oa oa oi oi oo oo ou ou ) - name+=set[rand(set.length)] when "W" # beginning vowel set=%w( a a a e e e i i i o o o u u u au au ay ay @@ -249,36 +246,46 @@ name+=set[rand(set.length)] when "U" # ending vowel - set=%w( a a a a e e i i o o o o u ay ay ie ie ee ue oo ) + set=%w( a a a a a e e e i i i o o o o o u u ay ay ie ie ee ue oo ) name+=set[rand(set.length)] when "B" # beginning consonant set1=%w( b c d f g h j k l l m n n p r r s s t t v w y z ) set2=%w( - bl br ch cl cr dr fr fl gh gl gr kh kl kr ph pl pr sc sk sl + bl br ch cl cr dr fr fl gl gr kh kl kr ph pl pr sc sk sl sm sn sp st sw th tr tw vl zh ) - name+=rand(2)==0 ? set1[rand(set1.length)] : set2[rand(set2.length)] + name+=rand(3)>0 ? set1[rand(set1.length)] : set2[rand(set2.length)] when "E" # ending consonant - set1=%w( b c d f g h j k k l l m n n p r r s s t t v x z ) - set2=%w( bb bs ch cs ds fs ft gs gh ld ls + set1=%w( b c d f g h j k k l l m n n p r r s s t t v z ) + set2=%w( bb bs ch cs ds fs ft gs gg ld ls nd nt ng nk rn kt ks ms ns ph pt ps sk sh sp ss st rd rn rp rm rt rk ns th zh) - name+=rand(2)==0 ? set1[rand(set1.length)] : set2[rand(set2.length)] + name+=rand(3)>0 ? set1[rand(set1.length)] : set2[rand(set2.length)] + when "f" # consonant and vowel + set=%w( iz us or ) + name+=set[rand(set.length)] + when "F" # consonant and vowel + set=%w( bo ba be bu re ro si mi zho se nya gru gruu glee gra glo ra do zo ri + di ze go ga pree pro po pa ka ki ku de da ma mo le la li ) + name+=set[rand(set.length)] when "2" set=%w( c f g k l p r s t ) name+=set[rand(set.length)] when "3" - set=%w( h k l s t ) + set=%w( nka nda la li ndra sta cha chie ) name+=set[rand(set.length)] when "4" - set=%w( una ona ina ita ila ala ana ia ) + set=%w( una ona ina ita ila ala ana ia iana ) name+=set[rand(set.length)] when "5" - set=%w( e e o o o o u u ito io ) + set=%w( e e o o ius io u u ito io ius us ) name+=set[rand(set.length)] when "6" - set=%w( a a a ili ine ite ina ita ila ala ana ) + set=%w( a a a elle ine ika ina ita ila ala ana ) name+=set[rand(set.length)] end } +if name.length>maxLength + return getRandomNameEx(type,variable,upper,maxLength) +end case upper when 0 @@ -295,6 +302,6 @@ -def getRandomName(*formats) - return getRandomNameEx(2,nil,nil,formats) +def getRandomName(maxLength=100) + return getRandomNameEx(2,nil,nil,maxLength) end @@ -331,7 +338,15 @@ def hasConst?(mod,constant) + + return false if !mod || !constant || constant=="" return mod.const_defined?(constant.to_sym) rescue false end +def getConst(mod,constant) + + return nil if !mod || !constant || constant=="" + return mod.const_get(constant.to_sym) rescue nil +end + module ItemStorageHelper # Implements methods that act on arrays of items. Each element @@ -698,5 +713,5 @@ end speciesname=PBSpecies.getName(species) - Kernel.pbMessage(_INTL("{1} obtained {2}!\\me[itemlevel]\1",$Trainer.name,speciesname)) + Kernel.pbMessage(_INTL("{1} obtained {2}!\\se[itemlevel]\1",$Trainer.name,speciesname)) pokemon=PokeBattle_Pokemon.new(species,level,$Trainer) pbNicknameAndStore(pokemon) @@ -712,5 +727,5 @@ end speciesname=PBSpecies.getName(pokemon.species) - Kernel.pbMessage(_INTL("{1} obtained {2}!\\me[itemlevel]\1",$Trainer.name,speciesname)) + Kernel.pbMessage(_INTL("{1} obtained {2}!\\se[itemlevel]\1",$Trainer.name,speciesname)) pbNicknameAndStore(pokemon) return true @@ -724,5 +739,5 @@ end speciesname=PBSpecies.getName(species) - Kernel.pbMessage(_INTL("{1} obtained {2}!\\me[itemlevel]\1",$Trainer.name,speciesname)) + Kernel.pbMessage(_INTL("{1} obtained {2}!\\se[itemlevel]\1",$Trainer.name,speciesname)) pokemon=PokeBattle_Pokemon.new(species,level,$Trainer) pbNicknameAndStore(pokemon) @@ -1121,5 +1136,5 @@ gender=pbGetTrainerTypeGender(trainertype) if trname=="" - trname=getRandomNameEx(gender,nil,1) + trname=getRandomNameEx(gender,nil,1,7) end $Trainer=PokeBattle_Trainer.new(trname,trainertype) Changed: PokeBattle_Battle --- Left +++ Right @@ -69,107 +69,15 @@ end +def pbSnagPokeBall(ball,rareness=nil) + pbThrowPokeBall(ball,rareness) +end + def pbThrowPokeBall(ball,rareness=nil) - if pbIsSnagBall?(ball) - pbSnagPokeBall(ball,rareness) - return - end itemname=PBItems.getName(ball) pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname)) - if @opponent + if @opponent && !pbIsSnagBall?(ball) @scene.pbThrowAndDeflect(ball,1) - pbDisplay(_INTL("The Trainer blocked the Ball! Don't be a thief!")) + pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!")) else - battler=self.battlers[1] - if battler.hp<=0 - battler=battler.pbPartner - end - if battler.hp<=0 - pbDisplay(_INTL("But there was no target...")) - return - end - pokemon=battler.pokemon - species=pokemon.species - if !rareness - dexdata=pbOpenDexData - pbDexDataOffset(dexdata,species,16) - rareness=dexdata.fgetb # Get rareness from dexdata file - dexdata.close - end - a=battler.totalhp - b=battler.hp - case ball - when PBItems::GREATBALL - rareness=(rareness*3/2).floor - when PBItems::SAFARIBALL - rareness=(rareness*3/2).floor - when PBItems::ULTRABALL - rareness*=2 - when PBItems::NETBALL - rareness*=3 if battler.pbHasType?(PBTypes::BUG) || battler.pbHasType?(PBTypes::WATER) - when PBItems::DIVEBALL - rareness=(rareness*7/2).floor if @environment==PBEnvironment::Underwater - when PBItems::TIMERBALL - if @turncount>30 - rareness*=4 - else - rareness=rareness*(@turncount+10)/10 - end - when PBItems::REPEATBALL - rareness*=3 if self.pbPlayer.owned[battler.species] - when PBItems::NESTBALL - if battler.level<30 - rareness*=(40-battler.level)/10 - end - end - x=(((a*3-b*2)*rareness)/(a*3)).floor - if battler.status==PBStatuses::SLEEP|| - battler.status==PBStatuses::FROZEN - x*=2 - elsif battler.status!=0 - x=(x*3/2).floor - end - shakes=0 - if x>255 || ball==PBItems::MASTERBALL - shakes=4 - else - x=1 if x==0 - y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) ) - shakes+=1 if pbRandom(65536)30 rareness*=4 @@ -207,7 +114,7 @@ rareness=rareness*(@turncount+10)/10 end - when PBItems::REPEATBALL + elsif isConst?(ball,PBItems,:REPEATBALL) rareness*=3 if self.pbPlayer.owned[battler.species] - when PBItems::NESTBALL + elsif isConst?(ball,PBItems,:NESTBALL) if battler.level<30 rareness*=(40-battler.level)/10 @@ -222,5 +129,5 @@ end shakes=0 - if x>255 || ball==PBItems::MASTERBALL + if x>255 || isConst?(ball,PBItems,:MASTERBALL) shakes=4 else @@ -245,5 +152,5 @@ pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name)) @scene.pbThrowSuccess - if @opponent + if pbIsSnagBall?(ball) && @opponent pbRemoveFromParty(battler.index,battler.pokemonIndex) # No need to add to player's party, happens in pbStorePokemon @@ -252,6 +159,8 @@ @decision=4 end - pokemon.ot=$Trainer.name - pokemon.trainerID=$Trainer.id + if pbIsSnagBall?(ball) + pokemon.ot=$Trainer.name + pokemon.trainerID=$Trainer.id + end if isConst?(ball,PBItems,:LUXURYBALL) pokemon.happiness=200 @@ -265,4 +174,5 @@ pbStorePokemon(pokemon) end + end end @@ -764,5 +674,5 @@ # If a participant is holding Amulet Coin, money earned is doubled for i in 0...@party1.length - if @participants[i] && @party1[i].hp>0 && !@party1[i].egg? && @party1[i].item==PBItems::AMULETCOIN + if @participants[i] && @party1[i].hp>0 && !@party1[i].egg? && isConst?(@party1[i].item,PBItems,:AMULETCOIN) maxlevel*=2 break @@ -884,9 +794,9 @@ return 0 end - if thispkmn.item==PBItems::SMOKEBALL + if isConst?(thispkmn.item,PBItems,:SMOKEBALL) if duringBattle pbDisplayPaused(_INTL("Got away safely!")) else - pbDisplayPaused(_INTL("{1} fled using its Smoke Ball!",thispkmn.pbThis)) + pbDisplayPaused(_INTL("{1} fled using its {2}!",thispkmn.pbThis,PBItems.getName(thispkmn.item))) end @decision=3 @@ -968,7 +878,9 @@ end if thispkmn.effects[PBEffects::ChoiceBand]!=0 && thismove.id!=thispkmn.effects[PBEffects::ChoiceBand]&& - thispkmn.item.id==PBItems::CHOICEBAND + isConst?(thispkmn.item,PBItems,:CHOICEBAND) if showMessages - pbDisplayPaused(_INTL("{1} allows it to use only {2}!",thispkmn.pbThis,thispkmn.effects[PBEffects::ChoiceBand].name)) + pbDisplayPaused(_INTL("{1} allows it to use only {2}!", + PBItems.getName(thispkmn.item), + thispkmn.effects[PBEffects::ChoiceBand].name)) end return false @@ -1299,237 +1211,5 @@ end end - case item - when PBItems::POTION - return pbBattleHPItem(pokemon, battler,20,scene) - when PBItems::CHERIBERRY, PBItems::PARLYZHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::PARALYSIS - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was cured of paralysis.",pokemon.name)) - pokemon.status=0 - battler.status=0 if battler - return true - end - when PBItems::CHESTOBERRY, PBItems::AWAKENING, PBItems::BLUEFLUTE - if pokemon.hp<=0 || pokemon.status!=PBStatuses::SLEEP - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} woke up.",pokemon.name)) - pokemon.status=0 - battler.status=0 if battler - return true - end - when PBItems::PECHABERRY, PBItems::ANTIDOTE - if pokemon.hp<=0 || pokemon.status!=PBStatuses::POISON - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was cured of its poisoning.",pokemon.name)) - pokemon.status=0 - battler.status=0 if battler - return true - end - when PBItems::RAWSTBERRY, PBItems::BURNHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::BURN - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s burn was healed.",pokemon.name)) - pokemon.status=0 - battler.status=0 if battler - return true - end - when PBItems::ASPEARBERRY, PBItems::ICEHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::FROZEN - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was thawed out.",pokemon.name)) - pokemon.status=0 - battler.status=0 if battler - return true - end - when PBItems::FULLRESTORE - if pokemon.hp<=0 || (pokemon.status==0 && pokemon.hp==pokemon.totalhp && - (!battler || battler.effects[PBEffects::Confusion]==0)) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - hpgain=pbItemRestoreHP(pokemon,pokemon.totalhp-pokemon.hp) - battler.hp=pokemon.hp if battler - pokemon.status=0 - battler.status=0 if battler - battler.effects[PBEffects::Confusion]=0 if battler - if hpgain>0 - scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",pokemon.name,hpgain)) - else - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - end - return true - end - when PBItems::MAXPOTION - return pbBattleHPItem(pokemon, battler,pokemon.totalhp-pokemon.hp,scene) - when PBItems::HYPERPOTION - return pbBattleHPItem(pokemon, battler,200,scene) - when PBItems::SUPERPOTION - return pbBattleHPItem(pokemon, battler,50,scene) - when PBItems::ORANBERRY - return pbBattleHPItem(pokemon, battler,10,scene) - when PBItems::BERRYJUICE - return pbBattleHPItem(pokemon, battler,20,scene) - when PBItems::SITRUSBERRY - return pbBattleHPItem(pokemon, battler,30,scene) - when PBItems::FULLHEAL, PBItems::LUMBERRY, PBItems::LAVACOOKIE - if pokemon.hp<=0 || (pokemon.status==0 && (!battler || battler.effects[PBEffects::Confusion]==0)) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - battler.status=0 if battler - battler.effects[PBEffects::Confusion]=0 if battler - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - return true - end - when PBItems::REVIVE - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=(pokemon.totalhp/2).floor - battler.pbInitialize(pokemon,pkmnindex,false) if battler - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - return true - end - when PBItems::MAXREVIVE - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=pokemon.totalhp - battler.pbInitialize(pokemon,pkmnindex,false) if battler - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - return true - end - when PBItems::FRESHWATER - return pbBattleHPItem(pokemon, battler,50,scene) - when PBItems::SODAPOP - return pbBattleHPItem(pokemon, battler,60,scene) - when PBItems::LEMONADE - return pbBattleHPItem(pokemon, battler,80,scene) - when PBItems::MOOMOOMILK - return pbBattleHPItem(pokemon, battler,100,scene) - when PBItems::ENERGYPOWDER - if pbBattleHPItem(pokemon, battler,50,scene) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - return false - when PBItems::ENERGYROOT - if pbBattleHPItem(pokemon, battler,200,scene) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - return false - when PBItems::HEALPOWDER - if pokemon.hp<=0 || (pokemon.status==0 && (!battler || battler.effects[PBEffects::Confusion]==0)) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - battler.status=0 if battler - battler.effects[PBEffects::Confusion]=0 if battler - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - when PBItems::REVIVALHERB - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=pokemon.totalhp - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - battler.pbInitialize(pokemon,pkmnindex,false) if battler - return true - end - when PBItems::LEPPABERRY, PBItems::ETHER - move=scene.pbChooseMove(pokemon,_INTL("Restore which move?")) - if move>=0 - if pbBattleRestorePP(pokemon,battler,move,10)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - end - return false - when PBItems::MAXETHER - move=scene.pbChooseMove(pokemon,_INTL("Restore which move?")) - if move>=0 - if pbBattleRestorePP(pokemon,battler,move,pokemon.moves[move].totalpp-pokemon.moves[move].pp)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - end - return false - when PBItems::ELIXIR - pprestored=0 - for i in 0...pokemon.moves.length - pprestored+=pbBattleRestorePP(pokemon,battler,i,10) - end - if pprestored==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - when PBItems::MAXELIXIR - pprestored=0 - for i in 0...pokemon.moves.length - pprestored+=pbBattleRestorePP(pokemon,battler,i,pokemon.moves[i].totalpp-pokemon.moves[i].pp) - end - if pprestored==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - when PBItems::REDFLUTE - if battler && battler.effects[PBEffects::Attract]>=0 - battler.effects[PBEffects::Attract]=-1 - scene.pbDisplay(_INTL("{1} got over its infatuation.",pokemon.name)) - return true # :consumed: - else - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - end - when PBItems::YELLOWFLUTE, PBItems::PERSIMBERRY - if battler && battler.effects[PBEffects::Confusion]>0 - battler.effects[PBEffects::Confusion]=0 - scene.pbDisplay(_INTL("{1} snapped out of confusion.",pokemon.name)) - return true # :consumed: - else - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - end - else - return ItemHandlers.triggerBattleUseOnPokemon(item,pokemon,battler,scene) - end + return ItemHandlers.triggerBattleUseOnPokemon(item,pokemon,battler,scene) end =begin @@ -1549,82 +1229,16 @@ return true end - case item - when PBItems::GUARDSPEC - if battler.pbOwnSide.effects[PBEffects::Mist]>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.pbOwnSide.effects[PBEffects::Mist]=5 - scene.pbDisplay(_INTL("Ally became shrouded in Mist!")) - return true - end - when PBItems::DIREHIT - if battler.effects[PBEffects::FocusEnergy] - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.effects[PBEffects::FocusEnergy]=true - scene.pbDisplay(_INTL("{1} is getting pumped!",battler.pbThis)) - return true - end - when PBItems::XATTACK - if battler.pbTooHigh?(PBStats::ATTACK) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.stages[PBStats::ATTACK]+=1 - scene.pbDisplay(_INTL("{1}'s Attack rose!",battler.pbThis)) - return true - end - when PBItems::XDEFEND - if battler.pbTooHigh?(PBStats::DEFENSE) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.stages[PBStats::DEFENSE]+=1 - scene.pbDisplay(_INTL("{1}'s Defense rose!",battler.pbThis)) - return true - end - when PBItems::XSPEED - if battler.pbTooHigh?(PBStats::SPEED) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.stages[PBStats::SPEED]+=1 - scene.pbDisplay(_INTL("{1}'s Speed rose!",battler.pbThis)) - return true - end - when PBItems::XACCURACY - if battler.pbTooHigh?(PBStats::ACCURACY) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.stages[PBStats::ACCURACY]+=1 - scene.pbDisplay(_INTL("{1}'s accuracy rose!",battler.pbThis)) - return true - end - when PBItems::XSPECIAL - if battler.pbTooHigh?(PBStats::SPATK) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - battler.stages[PBStats::SPATK]+=1 - scene.pbDisplay(_INTL("{1}'s Special Attack rose!",battler.pbThis)) - return true - end - when PBItems::POKeDOLL, PBItems::FLUFFYTAIL - if @opponent + if $ItemData[item][ITEMTYPE]==4 # Pokedoll-like item + if @opponent scene.pbDisplay(_INTL("Can't use that here.")) return false - else + else playername=self.pbPlayer.name itemname=PBItems.getName(item) scene.pbDisplay(_INTL("{1} used the {2}.",playername,itemname)) return true - end - else - return ItemHandlers.triggerBattleUseOnBattler(item,battler,scene) + end end - return false + return ItemHandlers.triggerBattleUseOnBattler(item,battler,scene) end @@ -1634,5 +1248,5 @@ @choices[idxPokemon][1]=idxItem # item used @choices[idxPokemon][2]=nil - if idxItem==PBItems::POKeDOLL||idxItem==PBItems::FLUFFYTAIL + if $ItemData[idxItem][ITEMTYPE]==4 @decision=3 pbDisplayPaused(_INTL("Got away safely!")) @@ -1651,17 +1265,20 @@ return 0 if battler.hp<=0 for i in items - if i==PBItems::POTION || i==PBItems::SUPERPOTION || - i==PBItems::HYPERPOTION || i==PBItems::MAXPOTION || - i==PBItems::FULLRESTORE + if isConst?(i,PBItems,:POTION) || + isConst?(i,PBItems,:SUPERPOTION) || + isConst?(i,PBItems,:HYPERPOTION) || + isConst?(i,PBItems,:MAXPOTION) || + isConst?(i,PBItems,:FULLRESTORE) hashpitem=true end end for i in items - case i - when PBItems::POTION, PBItems::SUPERPOTION, - PBItems::HYPERPOTION, PBItems::MAXPOTION + if isConst?(i,PBItems,:POTION) || + isConst?(i,PBItems,:SUPERPOTION) || + isConst?(i,PBItems,:HYPERPOTION) || + isConst?(i,PBItems,:MAXPOTION) return i if battler.hp<=(battler.totalhp/4).floor return i if battler.hp<=(battler.totalhp/2).floor && (pbAIRandom(10)<2) - when PBItems::FULLRESTORE + elsif isConst?(i,PBItems,:FULLRESTORE) return i if battler.hp<=(battler.totalhp/4).floor return i if battler.hp<=(battler.totalhp/2).floor && (pbAIRandom(10)<2) @@ -1669,15 +1286,15 @@ (battler.status>0 || battler.effects[PBEffects::Confusion]>0) && (pbAIRandom(10)<2) - when PBItems::FULLHEAL + elsif isConst?(i,PBItems,:FULLHEAL) return i if !hashpitem && (battler.status>0 || battler.effects[PBEffects::Confusion]>0) - when PBItems::XATTACK + elsif isConst?(i,PBItems,:XATTACK) return i if !battler.pbTooHigh?(PBStats::ATTACK) - when PBItems::XDEFEND + elsif isConst?(i,PBItems,:XDEFEND) return i if !battler.pbTooHigh?(PBStats::DEFENSE) - when PBItems::XSPEED + elsif isConst?(i,PBItems,:XSPEED) return i if !battler.pbTooHigh?(PBStats::SPEED) - when PBItems::XSPECIAL + elsif isConst?(i,PBItems,:XSPECIAL) return i if !battler.pbTooHigh?(PBStats::SPATK) - when PBItems::XACCURACY + elsif isConst?(i,PBItems,:XACCURACY) return i if !battler.pbTooHigh?(PBStats::ACCURACY) end @@ -1707,18 +1324,17 @@ itemname=PBItems.getName(item) pbDisplayBrief(_INTL("{1} used the\r\n{2}!",opponent.fullname,itemname)) - case item - when PBItems::POTION + if isConst?(item,PBItems,:POTION) battler.pbRecoverHP(20) pbDisplayBrief(_INTL("{1} regained health!",battler.pbThis)) - when PBItems::SUPERPOTION + elsif isConst?(item,PBItems,:SUPERPOTION) battler.pbRecoverHP(50) pbDisplayBrief(_INTL("{1} regained health!",battler.pbThis)) - when PBItems::HYPERPOTION + elsif isConst?(item,PBItems,:HYPERPOTION) battler.pbRecoverHP(200) pbDisplayBrief(_INTL("{1} regained health!",battler.pbThis)) - when PBItems::MAXPOTION + elsif isConst?(item,PBItems,:MAXPOTION) battler.pbRecoverHP(battler.totalhp-battler.hp) pbDisplayBrief(_INTL("{1} regained health!",battler.pbThis)) - when PBItems::XATTACK + elsif isConst?(item,PBItems,:XATTACK) if !battler.pbTooHigh?(PBStats::ATTACK) battler.stages[PBStats::ATTACK]+=1 @@ -1726,5 +1342,5 @@ pbDisplayBrief(_INTL("{1}'s Attack rose!",battler.pbThis)) end - when PBItems::XDEFEND + elsif isConst?(item,PBItems,:XDEFEND) if !battler.pbTooHigh?(PBStats::DEFENSE) battler.stages[PBStats::DEFENSE]+=1 @@ -1732,5 +1348,5 @@ pbDisplayBrief(_INTL("{1}'s Defense rose!",battler.pbThis)) end - when PBItems::XSPEED + elsif isConst?(item,PBItems,:XSPEED) if !battler.pbTooHigh?(PBStats::SPEED) battler.stages[PBStats::SPEED]+=1 @@ -1738,5 +1354,5 @@ pbDisplayBrief(_INTL("{1}'s Speed rose!",battler.pbThis)) end - when PBItems::XSPECIAL + elsif isConst?(item,PBItems,:XSPECIAL) if !battler.pbTooHigh?(PBStats::SPATK) battler.stages[PBStats::SPATK]+=1 @@ -1744,5 +1360,5 @@ pbDisplayBrief(_INTL("{1}'s Special Attack rose!",battler.pbThis)) end - when PBItems::XACCURACY + elsif isConst?(item,PBItems,:XACCURACY) if !battler.pbTooHigh?(PBStats::ACCURACY) battler.stages[PBStats::ACCURACY]+=1 @@ -1750,5 +1366,5 @@ pbDisplayBrief(_INTL("{1}'s accuracy rose!",battler.pbThis)) end - when PBItems::FULLRESTORE + elsif isConst?(item,PBItems,:FULLRESTORE) fullhp=(battler.hp==battler.totalhp) battler.pbRecoverHP(battler.totalhp-battler.hp) @@ -1760,5 +1376,5 @@ pbDisplayBrief(_INTL("{1} regained health!",battler.pbThis)) end - when PBItems::FULLHEAL + elsif isConst?(item,PBItems,:FULLHEAL) battler.status=0 battler.effects[PBEffects::Confusion]=0 @@ -1798,8 +1414,8 @@ speeds[2]=@battlers[2].pbSpeed speeds[3]=@battlers[3].pbSpeed - quickclaw[0]=@battlers[0].item==PBItems::QUICKCLAW - quickclaw[1]=@battlers[1].item==PBItems::QUICKCLAW - quickclaw[2]=@battlers[2].item==PBItems::QUICKCLAW - quickclaw[3]=@battlers[3].item==PBItems::QUICKCLAW + quickclaw[0]=isConst?(@battlers[0].item,PBItems,:QUICKCLAW) + quickclaw[1]=isConst?(@battlers[1].item,PBItems,:QUICKCLAW) + quickclaw[2]=isConst?(@battlers[2].item,PBItems,:QUICKCLAW) + quickclaw[3]=isConst?(@battlers[3].item,PBItems,:QUICKCLAW) # Find the maximum and minimum priority for i in 0..3 @@ -2063,5 +1679,5 @@ for j in 0..@party1.length-1 next if !@party1[j] || !pbIsOwner?(0,j) - expshare+=1 if @party1[j].hp>0 && !@party1[j].egg? && @party1[j].item==PBItems::EXPSHARE + expshare+=1 if @party1[j].hp>0 && !@party1[j].egg? && isConst?(@party1[j].item,PBItems,:EXPSHARE) end # Now calculate EXP for the participants @@ -2076,5 +1692,5 @@ ispartic=0 level=@battlers[i].level - haveexpshare=(thispoke.item==PBItems::EXPSHARE) ? 1 : 0 + haveexpshare=(isConst?(thispoke.item,PBItems,:EXPSHARE)) ? 1 : 0 for k in @battlers[i].participants ispartic=1 if k==j @@ -2090,5 +1706,5 @@ exp=(exp*3/2).floor if @opponent exp=(exp*3/2).floor if thispoke.trainerID!=self.pbPlayer.id - exp=(exp*3/2).floor if thispoke.item==PBItems::LUCKYEGG + exp=(exp*3/2).floor if isConst?(thispoke.item,PBItems,:LUCKYEGG) growthrate=thispoke.growthrate newexp=PBExperience.pbAddExperience(thispoke.exp,exp,growthrate) @@ -2109,5 +1725,5 @@ for k in 0..5 evgain=dexdata.fgetb - if thispoke.item==PBItems::MACHOBRACE + if isConst?(thispoke.item,PBItems,:MACHOBRACE) evgain*=2 end @@ -2893,5 +2509,5 @@ damage=1 if damage<1 i.damagestate.reset - if i.item==PBItems::FOCUSBAND && pbRandom(10)==0 + if isConst?(i.item,PBItems,:FOCUSBAND) && pbRandom(10)==0 i.damagestate.focusband=true end Changed: PokemonItems --- Left +++ Right @@ -13,4 +13,8 @@ end +def pbIsBattleEndingItem?(item) + return $ItemData[item] && ($ItemData[item][ITEMTYPE]==4) +end + def pbTopRightWindow(text) window=Window_UnformattedTextPokemon.new(text) @@ -31,67 +35,120 @@ end -def itemFromSymbol(item) - if item.is_a?(Symbol) || item.is_a?(String) - begin - return PBItems.const_get(item.to_sym) - rescue - return nil +class HandlerHash + def initialize(mod) + @mod=mod + @hash={} + @symbolCache={} + end + def fromSymbol(sym) + if sym.is_a?(Symbol) || sym.is_a?(String) + mod=Object.const_get(@mod) rescue nil + return nil if !mod + return mod.const_get(sym.to_sym) rescue nil + else + return sym end - else - return item end + def toSymbol(sym) + if sym.is_a?(Symbol) || sym.is_a?(String) + return sym.to_sym + else + ret=@symbolCache[sym] + return ret if ret + mod=Object.const_get(@mod) rescue nil + return nil if !mod + for key in mod.constants + if mod.const_get(key)==sym + ret=key.to_sym + @symbolCache[sym]=ret + break + end + end + return ret + end + end + def add(sym,handler) # 'sym' can be an ID or symbol + id=fromSymbol(sym) + @hash[id]=handler if id + symbol=toSymbol(sym) + @hash[symbol]=handler if symbol + end + def copy(src,*dests) + handler=self[src] + if handler + for dest in dests + self.add(dest,handler) + end + end + end + def [](sym) # 'sym' can be an ID or symbol + id=fromSymbol(sym) + if id && @hash[id] # Real ID from the item + return @hash[id] + end + symbol=toSymbol(sym) + if symbol && @hash[symbol] # Symbol or string + return @hash[symbol] + end + return nil + end + def trigger(sym,*args) + handler=self[sym] + return handler ? handler.call(fromSymbol(sym),*args) : nil + end + def clear + @hash.clear + end end +class ItemHandlerHash < HandlerHash + def initialize + super(:PBItems) + end +end module ItemHandlers - @@useFromBag={} - @@useInField={} - @@useOnPokemon={} - @@battleUseOnBattler={} - @@battleUseOnPokemon={} + UseFromBag=ItemHandlerHash.new + UseInField=ItemHandlerHash.new + UseOnPokemon=ItemHandlerHash.new + BattleUseOnBattler=ItemHandlerHash.new + BattleUseOnPokemon=ItemHandlerHash.new def self.addUseFromBag(item,proc) - return if (item=itemFromSymbol(item))==nil - @@useFromBag[item]=proc + UseFromBag.add(item,proc) end def self.addUseInField(item,proc) - return if (item=itemFromSymbol(item))==nil - @@useInField[item]=proc + UseInField.add(item,proc) end def self.addUseOnPokemon(item,proc) - return if (item=itemFromSymbol(item))==nil - @@useOnPokemon[item]=proc + UseOnPokemon.add(item,proc) end def self.addBattleUseOnBattler(item,proc) - return if (item=itemFromSymbol(item))==nil - @@battleUseOnBattler[item]=proc + BattleUseOnBattler.add(item,proc) end def self.addBattleUseOnPokemon(item,proc) - return if (item=itemFromSymbol(item))==nil - @@battleUseOnPokemon[item]=proc + BattleUseOnPokemon.add(item,proc) end def self.triggerUseFromBag(item) # Return value: # 0 - Item not used - # 1 - Item used + # 1 - Item used, don't end screen # 2 - Item used, end screen # 3 - Item used, consume item - return 0 if (item=itemFromSymbol(item))==nil - if !@@useFromBag[item] + if !UseFromBag[item] # Check the UseInField handler if present - if @@useInField[item] - @@useInField[item].call(item) + if UseInField[item] + UseInField.trigger(item) return 1 # item was used end return 0 # item was not used else - return @@useFromBag[item].call(item) + UseFromBag.trigger(item) end end def self.triggerUseInField(item) # No return value - return false if (item=itemFromSymbol(item))==nil - if !@@useInField[item] + if !UseInField[item] return false else - @@useInField[item].call(item) + UseInField.trigger(item) return true end @@ -99,27 +156,24 @@ def self.triggerUseOnPokemon(item,pokemon,scene) # Returns whether item was used - return false if (item=itemFromSymbol(item))==nil - if !@@useOnPokemon[item] + if !UseOnPokemon[item] return false else - return @@useOnPokemon[item].call(item,pokemon,scene) + return UseOnPokemon.trigger(item,pokemon,scene) end end def self.triggerBattleUseOnBattler(item,battler,scene) # Returns whether item was used - return false if (item=itemFromSymbol(item))==nil - if !@@battleUseOnBattler[item] + if !BattleUseOnBattler[item] return false else - return @@battleUseOnBattler[item].call(item,battler,scene) + return BattleUseOnBattler.trigger(item,battler,scene) end end def self.triggerBattleUseOnPokemon(item,pokemon,battler,scene) # Returns whether item was used - return false if (item=itemFromSymbol(item))==nil - if !@@battleUseOnPokemon[item] + if !BattleUseOnPokemon[item] return false else - return @@battleUseOnPokemon[item].call(item,pokemon,battler,scene) + return BattleUseOnPokemon.trigger(item,pokemon,battler,scene) end end @@ -239,107 +293,15 @@ end - -def pbUseItemFromBag(item) - case item - when PBItems::COINCASE - Kernel.pbMessage(_INTL("Coins: {1}",$PokemonGlobal.coins)) - return 1 # Continue - when PBItems::TOWNMAP - pbShowMap - return 1 - when PBItems::MACHBIKE, PBItems::ACROBIKE - return pbBikeCheck ? 2 : 0 - when PBItems::POKeBLOCKCASE - return 2 - when PBItems::ITEMFINDER - return 2 - when PBItems::OLDROD, PBItems::GOODROD, PBItems::SUPERROD - terrain=Kernel.pbFacingTerrainTag - if pbIsWaterTag?(terrain) - return 2 - else - Kernel.pbMessage(_INTL("Can't use that here.")) - return 0 - end - when PBItems::BLACKFLUTE - Kernel.pbMessage(_INTL("{1} used the Black Flute.",$Trainer.name)) - Kernel.pbMessage(_INTL("Wild Pokémon will be repelled.")) - $PokemonMap.blackFluteUsed=true - $PokemonMap.whiteFluteUsed=false - return 1 - when PBItems::WHITEFLUTE - Kernel.pbMessage(_INTL("{1} used the White Flute.",$Trainer.name)) - Kernel.pbMessage(_INTL("Wild Pokémon will be lured.")) - $PokemonMap.blackFluteUsed=false - $PokemonMap.whiteFluteUsed=true - return 1 - when PBItems::SUPERREPEL +def pbRepel(item,steps) if $PokemonGlobal.repel>0 Kernel.pbMessage(_INTL("But the effects of a Repel lingered from earlier.")) return 0 else - Kernel.pbMessage(_INTL("{1} used the Super Repel.",$Trainer.name)) - $PokemonGlobal.repel=200 + Kernel.pbMessage(_INTL("{1} used the {2}.",$Trainer.name,PBItems.getName(item))) + $PokemonGlobal.repel=steps return 3 end - when PBItems::MAXREPEL - if $PokemonGlobal.repel>0 - Kernel.pbMessage(_INTL("But the effects of a Repel lingered from earlier.")) - return 0 - else - Kernel.pbMessage(_INTL("{1} used the Max Repel.",$Trainer.name)) - $PokemonGlobal.repel=250 - return 3 - end - when PBItems::REPEL - if $PokemonGlobal.repel>0 - Kernel.pbMessage(_INTL("But the effects of a Repel lingered from earlier.")) - return 0 - else - Kernel.pbMessage(_INTL("{1} used the Repel.",$Trainer.name)) - $PokemonGlobal.repel=100 - return 3 - end - when PBItems::ESCAPEROPE - if $game_player.pbHasDependentEvents? - Kernel.pbMessage(_INTL("You can't use that if you have someone with you.")) - return 0 - end - if pbGetMetadata($game_map.map_id,MetadataEscapePoint) - return 2 - else - Kernel.pbMessage(_INTL("Can't use that here.")) - return 0 - end - when PBItems::SACREDASH - revived=0 - if $Trainer.pokemonCount==0 - Kernel.pbMessage(_INTL("There is no Pokémon.")) - return 0 - end - pbFadeOutIn(99999){ - scene=PokemonScreen_Scene.new - screen=PokemonScreen.new(scene,$Trainer.party) - screen.pbStartScene(_INTL("Using item..."),false) - for i in $Trainer.party - if i.hp<=0 && !i.egg? - revived+=1 - i.hp=i.totalhp - i.status=0 - screen.pbDisplay(_INTL("{1} regained health.",i.name)) - end - end - if revived==0 - screen.pbDisplay(_INTL("It won't have any effect.")) - end - screen.pbEndScene - } - return (revived==0) ? 0 : 3 - else - return ItemHandlers.triggerUseFromBag(item) - end end - def pbClosestHiddenItem result = [] @@ -368,99 +330,9 @@ def Kernel.pbUseKeyItemInField(item) - case item - when PBItems::OLDROD, PBItems::GOODROD, PBItems::SUPERROD - terrain=Kernel.pbFacingTerrainTag - if !pbIsWaterTag?(terrain) - Kernel.pbMessage(_INTL("Can't use that here.")) - return - end - enctype=4 # Old Rod - enctype=5 if item==PBItems::GOODROD - enctype=6 if item==PBItems::SUPERROD - encounter=$PokemonEncounters.hasEncounter?(enctype) - if pbFishing(encounter) - pbEncounter(enctype) - end - when PBItems::TOWNMAP - pbShowMap - when PBItems::ESCAPEROPE - escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint) - if !escape - Kernel.pbMessage(_INTL("Can't use that here.")) - return - end - if $game_player.pbHasDependentEvents? - Kernel.pbMessage(_INTL("You can't use that if you have someone with you.")) - return - end - Kernel.pbMessage(_INTL("{1} used the Escape Rope.",$Trainer.name)) - pbFadeOutIn(99999){ - Kernel.pbCancelVehicles - $game_temp.player_new_map_id=escape[0] - $game_temp.player_new_x=escape[1] - $game_temp.player_new_y=escape[2] - $game_temp.player_new_direction=2 - $scene.transfer_player - $game_map.autoplay - $game_map.refresh - } - $PokemonBag.pbDeleteItem(item) - when PBItems::MACHBIKE, PBItems::ACROBIKE - if pbBikeCheck - if $PokemonGlobal.bicycle - Kernel.pbDismountBike - else - Kernel.pbMountBike - end - end - when PBItems::POKeBLOCKCASE - # Todo: Implement - Kernel.pbMessage(_INTL("Can't use that here.")) - when PBItems::ITEMFINDER - event=pbClosestHiddenItem - if !event - Kernel.pbMessage(_INTL("...Nope!\r\nThere's no response.")) - else - offsetX=event.x-$game_player.x - offsetY=event.y-$game_player.y - if offsetX==0 && offsetY==0 - for i in 0...32 - Graphics.update - Input.update - $game_player.turn_right_90 if (i&7)==0 - pbUpdateSceneMap - end - Kernel.pbMessage(_INTL("Oh! The Itemfinder's shaking wildly!\1")) - Kernel.pbMessage(_INTL("There's an item buried underfoot!")) - else - direction=$game_player.direction - if offsetX.abs>offsetY.abs - direction=(offsetX<0) ? 4 : 6 - else - direction=(offsetY<0) ? 8 : 2 - end - for i in 0...8 - Graphics.update - Input.update - if i==0 - $game_player.turn_down if direction==2 - $game_player.turn_left if direction==4 - $game_player.turn_right if direction==6 - $game_player.turn_up if direction==8 - end - pbUpdateSceneMap - end - Kernel.pbMessage(_INTL("Oh! The Itemfinder's responding!\1")) - Kernel.pbMessage(_INTL("There's an item buried around here!")) - end - end - else if !ItemHandlers.triggerUseInField(item) Kernel.pbMessage(_INTL("Can't use that here.")) end - end end - def pbMachineAnnotations(move) ret=[] @@ -570,351 +442,4 @@ end -def pbUseItemOnPokemon(item,pokemon,scene) - if pokemon.egg? - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - end - case item - when PBItems::POTION - return pbHPItem(pokemon,20,scene) - when PBItems::CHERIBERRY, PBItems::PARLYZHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::PARALYSIS - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was cured of paralysis.",pokemon.name)) - pokemon.status=0 - return true - end - when PBItems::CHESTOBERRY, PBItems::AWAKENING, PBItems::BLUEFLUTE - if pokemon.hp<=0 || pokemon.status!=PBStatuses::SLEEP - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} woke up.",pokemon.name)) - pokemon.status=0 - return true - end - when PBItems::PECHABERRY, PBItems::ANTIDOTE - if pokemon.hp<=0 || pokemon.status!=PBStatuses::POISON - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was cured of its poisoning.",pokemon.name)) - pokemon.status=0 - return true - end - when PBItems::RAWSTBERRY, PBItems::BURNHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::BURN - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s burn was healed.",pokemon.name)) - pokemon.status=0 - return true - end - when PBItems::ASPEARBERRY, PBItems::ICEHEAL - if pokemon.hp<=0 || pokemon.status!=PBStatuses::FROZEN - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1} was thawed out.",pokemon.name)) - pokemon.status=0 - return true - end - when PBItems::FULLRESTORE - if pokemon.hp<=0 || (pokemon.status==0 && pokemon.hp==pokemon.totalhp) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - hpgain=pbItemRestoreHP(pokemon,pokemon.totalhp-pokemon.hp) - pokemon.status=0 - if hpgain>0 - scene.pbDisplay(_INTL("{1}'s HP was restored by {2} points.",pokemon.name,hpgain)) - else - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - end - return true - end - when PBItems::MAXPOTION - return pbHPItem(pokemon,pokemon.totalhp-pokemon.hp,scene) - when PBItems::HYPERPOTION - return pbHPItem(pokemon,200,scene) - when PBItems::SUPERPOTION - return pbHPItem(pokemon,50,scene) - when PBItems::ORANBERRY - return pbHPItem(pokemon,10,scene) - when PBItems::BERRYJUICE - return pbHPItem(pokemon,20,scene) - when PBItems::SITRUSBERRY - return pbHPItem(pokemon,30,scene) - when PBItems::FULLHEAL, PBItems::LUMBERRY, PBItems::LAVACOOKIE - if pokemon.hp<=0 || (pokemon.status==0) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - return true - end - when PBItems::REVIVE - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=(pokemon.totalhp/2).floor - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - return true - end - when PBItems::MAXREVIVE - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=pokemon.totalhp - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - return true - end - when PBItems::FRESHWATER - return pbHPItem(pokemon,50,scene) - when PBItems::SODAPOP - return pbHPItem(pokemon,60,scene) - when PBItems::LEMONADE - return pbHPItem(pokemon,80,scene) - when PBItems::MOOMOOMILK - return pbHPItem(pokemon,100,scene) - when PBItems::ENERGYPOWDER - if pbHPItem(pokemon,50,scene) - pokemon.happiness-=5 - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - return false - when PBItems::ENERGYROOT - if pbHPItem(pokemon,200,scene) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - return false - when PBItems::HEALPOWDER - if pokemon.hp<=0 || (pokemon.status==0) - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - scene.pbDisplay(_INTL("{1} became healthy.",pokemon.name)) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - when PBItems::REVIVALHERB - if pokemon.hp>0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.status=0 - pokemon.hp=pokemon.totalhp - scene.pbDisplay(_INTL("{1} regained health.",pokemon.name)) - pokemon.happiness-=5 # TODO: Don't know actual amount - pokemon.happiness=0 if pokemon.happiness<0 - return true - end - when PBItems::LEPPABERRY, PBItems::ETHER - move=scene.pbChooseMove(pokemon,_INTL("Restore which move?")) - if move>=0 - if pbRestorePP(pokemon,move,10)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - end - return false - when PBItems::MAXETHER - move=scene.pbChooseMove(pokemon,_INTL("Restore which move?")) - if move>=0 - if pbRestorePP(pokemon,move,pokemon.moves[move].totalpp-pokemon.moves[move].pp)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - end - return false - when PBItems::ELIXIR - pprestored=0 - for i in 0...pokemon.moves.length - pprestored+=pbRestorePP(pokemon,i,10) - end - if pprestored==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - when PBItems::MAXELIXIR - pprestored=0 - for i in 0...pokemon.moves.length - pprestored+=pbRestorePP(pokemon,i,pokemon.moves[i].totalpp-pokemon.moves[i].pp) - end - if pprestored==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("PP was restored.")) - return true - end - when PBItems::HPUP - if pbRaiseEffortValues(pokemon,0)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s HP increased.",pokemon.name)) - return true - end - when PBItems::PROTEIN - if pbRaiseEffortValues(pokemon,1)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s Attack increased.",pokemon.name)) - return true - end - when PBItems::IRON - if pbRaiseEffortValues(pokemon,2)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s Defense increased.",pokemon.name)) - return true - end - when PBItems::CARBOS - if pbRaiseEffortValues(pokemon,3)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s Speed increased.",pokemon.name)) - return true - end - when PBItems::CALCIUM - if pbRaiseEffortValues(pokemon,4)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s Special Attack increased.",pokemon.name)) - return true - end - when PBItems::ZINC - if pbRaiseEffortValues(pokemon,5)==0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - scene.pbDisplay(_INTL("{1}'s Special Defense increased.",pokemon.name)) - return true - end - when PBItems::RARECANDY - if pokemon.level>=PBExperience::MAXLEVEL - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.level+=1 - scene.pbDisplay(_INTL("{1} was elevated to Level {2}!",pokemon.name,pokemon.level)) - attackdiff=pokemon.attack - defensediff=pokemon.defense - speeddiff=pokemon.speed - spatkdiff=pokemon.spatk - spdefdiff=pokemon.spdef - totalhpdiff=pokemon.totalhp - pokemon.calcStats - attackdiff=pokemon.attack-attackdiff - defensediff=pokemon.defense-defensediff - speeddiff=pokemon.speed-speeddiff - spatkdiff=pokemon.spatk-spatkdiff - spdefdiff=pokemon.spdef-spdefdiff - totalhpdiff=pokemon.totalhp-totalhpdiff - pbTopRightWindow(_INTL("MaxHP: +{1}\r\nATTACK: +{2}\r\nDEFENSE: +{3}\r\nSP. ATK: +{4}\r\nSP. DEF: +{5}\r\nSPEED: +{6}", - totalhpdiff,attackdiff,defensediff,spatkdiff,spdefdiff,speeddiff)) - pbTopRightWindow(_INTL("MaxHP: {1}\r\nATTACK: {2}\r\nDEFENSE: {3}\r\nSP. ATK: {4}\r\nSP. DEF: {5}\r\nSPEED: {6}", - pokemon.totalhp,pokemon.attack,pokemon.defense,pokemon.speed,pokemon.spatk,pokemon.spdef)) - atkdata=pbRgssOpen("Data/attacksRS.dat","rb") - offset=atkdata.getOffset(pokemon.species-1) - length=atkdata.getLength(pokemon.species-1)>>1 - atkdata.pos=offset - for k in 0..length-1 - level=atkdata.fgetw - move=atkdata.fgetw - if level==pokemon.level - # Learned a new move - pbLearnMove(pokemon,move,true) - end - end - atkdata.close - newspecies=pbCheckEvolution(pokemon) - if newspecies>0 - pbFadeOutInWithMusic(99999){ - evo=PokemonEvolutionScene.new - evo.pbStartScreen(pokemon,newspecies) - evo.pbEvolution - evo.pbEndScreen - scene.pbHardRefresh - } - end - return true - end - when PBItems::PPUP - move=scene.pbChooseMove(pokemon,_INTL("Boost PP of which move?")) - if move>=0 - if pokemon.moves[move].ppup>=3 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.moves[move].ppup+=1 - movename=PBMoves.getName(pokemon.moves[move].id) - scene.pbDisplay(_INTL("{1}'s PP increased.",movename)) - return true - end - end - when PBItems::PPMAX - move=scene.pbChooseMove(pokemon,_INTL("Boost PP of which move?")) - if move>=0 - if pokemon.moves[move].ppup>=3 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pokemon.moves[move].ppup=3 - movename=PBMoves.getName(pokemon.moves[move].id) - scene.pbDisplay(_INTL("{1}'s PP increased.",movename)) - return true - end - end - return false - when PBItems::SUNSTONE, PBItems::MOONSTONE, - PBItems::FIRESTONE, PBItems::THUNDERSTONE, - PBItems::WATERSTONE, PBItems::LEAFSTONE - newspecies=pbCheckEvolution(pokemon,item) - if newspecies<=0 - scene.pbDisplay(_INTL("It won't have any effect.")) - return false - else - pbFadeOutInWithMusic(99999){ - evo=PokemonEvolutionScene.new - evo.pbStartScreen(pokemon,newspecies) - evo.pbEvolution(false) - evo.pbEndScreen - scene.pbRefresh - } - return true - end - else - return ItemHandlers.triggerUseOnPokemon(item,pokemon,scene) - end -end - def pbUseItem(bag,item) found=false @@ -928,12 +453,17 @@ scene=PokemonScreen_Scene.new screen=PokemonScreen.new(scene,$Trainer.party) - screen.pbStartScene(_INTL("Use on which Pokémon?"),false) - chosen=screen.pbChoosePokemon - if chosen>=0 - pokemon=$Trainer.party[chosen] - ret=pbUseItemOnPokemon(item,pokemon,screen) - else + screen.pbStartScene(_INTL("Use on which Pokémon?"),false) + chosen=screen.pbChoosePokemon + if chosen>=0 + pokemon=$Trainer.party[chosen] + if pokemon.egg? + screen.pbDisplay(_INTL("It won't have any effect.")) ret=false + else + ret=ItemHandlers.triggerUseOnPokemon(item,pokemon,screen) end + else + ret=false + end screen.pbEndScene } @@ -944,5 +474,5 @@ end if $ItemData[item][ITEMUSE]==2 # Item is usable from bag - intret=pbUseItemFromBag(item) + intret=ItemHandlers.triggerUseFromBag(item) case intret when 0 Changed: PokeBattle_SafariZone --- Left +++ Right @@ -106,5 +106,8 @@ @ballcount-=1 rare=(g*1275)/100 - pbThrowPokeBall(PBItems::SAFARIBALL,rare) + safariBall=getConst(PBItems,:SAFARIBALL) + if safariBall + pbThrowPokeBall(safariBall,rare) + end when 3 # Run pbDisplayPaused(_INTL("Got away safely!")) Changed: PokeBattle_MoveEffects --- Left +++ Right @@ -2253,5 +2253,5 @@ @battle.pbDisplay(_INTL("But it failed!")) return -1 - elsif attacker.item==PBItems::SMOKEBALL|| + elsif isConst?(attacker.item,PBItems,:SMOKEBALL)|| attacker.ability==PBAbilities::RUNAWAY|| @battle.pbCanSwitch?(attacker.index,-1,false) @@ -2677,6 +2677,6 @@ return -1 end - if attacker.item==PBItems::ENIGMABERRY|| - opponent.item==PBItems::ENIGMABERRY + if isConst?(attacker.item,PBItems,:ENIGMABERRY)|| + isConst?(opponent.item,PBItems,:ENIGMABERRY) @battle.pbDisplay(_INTL("But it failed!")) return -1 Changed: Compiler --- Left +++ Right @@ -337,8 +337,30 @@ end +class ItemList + include Enumerable + def initialize + @list=[] + end + def []=(x,v); @list[x]=v; end + def [](x) + if !@list[x] + defrecord=SerialRecord.new + defrecord.push(0) + defrecord.push("????????") + defrecord.push(0) + defrecord.push(0) + defrecord.push("????????") + return defrecord + end + return @list[x] + end + def length; @list.length; end + def each; @list.each {|i| yield i } ; end +end + def readItemList(filename) - ret=[] + ret=ItemList.new if !pbRgssExists?(filename) - return ret + ret.freeze; return ret end pbRgssOpen(filename,"rb"){|file| @@ -354,15 +376,4 @@ end } - defrecord=SerialRecord.new - defrecord.push(0) - defrecord.push("????????") - defrecord.push(0) - defrecord.push(0) - defrecord.push("????????") - for i in 0...ret.length - if !ret[i] - ret[i]=defrecord - end - end ret.freeze return ret @@ -3023,5 +3034,5 @@ newEvents=[] pbPushEvent(newEvents,111,[7,cost,0],oldIndent) - pbPushBranch(newEvents,"$PokemonBag.pbStoreItem(PBItems::#{itemname})",oldIndent+1) + pbPushBranch(newEvents,"$PokemonBag.pbStoreItem(PBItems:"+":#{itemname})",oldIndent+1) pbPushEvent(newEvents,125,[1,0,cost],oldIndent+2) pbPushText(newEvents,_INTL("\\se[save]Here you are!\\nThank you!"),oldIndent+2) @@ -3260,5 +3271,5 @@ page.list=[] pbPushBranch(page.list, - sprintf("Kernel.pbItemBall(::PBItems::%s)",itemname)) + sprintf("Kernel.pbItemBall(::PBItems:"+":%s)",itemname)) pbPushSelfSwitch(page.list,"A",true,1) pbPushElse(page.list,1) @@ -3422,5 +3433,5 @@ return nil end - safetrcombo=sprintf("PBTrainers::%s,\"%s\"",trtype,safequote(trname)) + safetrcombo=sprintf("PBTrainers:"+":%s,\"%s\"",trtype,safequote(trname)) introplay=sprintf("pbTrainerIntro(:%s)",trtype) pbPushScript(firstpage.list,introplay) @@ -3524,12 +3535,4 @@ end -def constDef?(mod,constant) - begin - return mod.const_defined?(constant.to_sym) - rescue - return false - end -end - def pbCompileAnimations begin @@ -3561,5 +3564,5 @@ next if !pbanims[i] if pbanims[i].name[/^Move\:\s*(.*)$/] - if constDef?(PBMoves,$~[1]) + if hasConst?(PBMoves,$~[1]) moveid=PBMoves.const_get($~[1]) move2anim[0][moveid]=i Changed: PokemonBerries --- Left +++ Right @@ -75,5 +75,5 @@ berryData=[0,0,false,0,0] end - watering=PBItems::WAILMERPAIL + watering=getConst(PBItems,:WAILMERPAIL) berry=berryData[1] case berryData[0] @@ -130,5 +130,5 @@ case berryData[0] when 1, 2, 3, 4 - if($PokemonBag.pbQuantity(watering)>0) + if($PokemonBag.pbQuantity(watering)>0) && watering if Kernel.pbConfirmMessage(_INTL("Would you like to water the {1} plant with the {2}?", PBItems.getName(berryData[1]),PBItems.getName(watering))) Changed: PokemonEditor --- Left +++ Right @@ -1033,5 +1033,5 @@ class TrainerTypeLister def initialize(selection,includeNew) - @sprite=SpriteWrapper.new + @sprite=IconSprite.new(0,0) @sprite.bitmap=nil @sprite.z=2 Changed: PokeBattle_Move --- Left +++ Right @@ -132,8 +132,8 @@ accuracy=(accuracy*4/5).floor end - if opponent.item==PBItems::BRIGHTPOWDER + if isConst?(opponent.item,PBItems,:BRIGHTPOWDER) accuracy=(accuracy*90/100).floor end - if opponent.item==PBItems::LAXINCENSE + if isConst?(opponent.item,PBItems,:LAXINCENSE) accuracy=(accuracy*95/100).floor end @@ -191,11 +191,11 @@ c=c+1 end - if isConst?(attacker.species,PBSpecies,:CHANSEY) && attacker.item==PBItems::LUCKYPUNCH + if isConst?(attacker.species,PBSpecies,:CHANSEY) && isConst?(attacker.item,PBItems,:LUCKYPUNCH) c=c+2 end - if isConst?(attacker.species,PBSpecies,:FARFETCHD) && attacker.item==PBItems::STICK + if isConst?(attacker.species,PBSpecies,:FARFETCHD) && isConst?(attacker.item,PBItems,:STICK) c=c+2 end - c=c+1 if attacker.item==PBItems::SCOPELENS + c=c+1 if isConst?(attacker.item,PBItems,:SCOPELENS) c=4 if c>4 return @battle.pbRandom(ratios[c])==0 @@ -266,18 +266,18 @@ defense=(defense/2).floor end - if isConst?(opponent.species,PBSpecies,:CLAMPERL)&&opponent.item==PBItems::DEEPSEASCALE + if isConst?(opponent.species,PBSpecies,:CLAMPERL)&&isConst?(opponent.item,PBItems,:DEEPSEASCALE) spdef*=2 end if (isConst?(opponent.species,PBSpecies,:LATIOS)|| isConst?(opponent.species,PBSpecies,:LATIAS))&& - opponent.item==PBItems::SOULDEW + isConst?(opponent.item,PBItems,:SOULDEW) spdef*=2 #except in Battle Tower/Battle Frontier end if (isConst?(opponent.species,PBSpecies,:LATIOS)|| isConst?(opponent.species,PBSpecies,:LATIAS))&& - attacker.item==PBItems::SOULDEW + isConst?(attacker.item,PBItems,:SOULDEW) spatk*=2 #except in Battle Tower/Battle Frontier end - if isConst?(opponent.species,PBSpecies,:DITTO)&&opponent.item==PBItems::METALPOWDER + if isConst?(opponent.species,PBSpecies,:DITTO)&&isConst?(opponent.item,PBItems,:METALPOWDER) defense*=2 end @@ -285,34 +285,34 @@ modatk=(atk*1.1).floor modspatk=(spatk*1.1).floor - atk=modatk if attacker.item==PBItems::SILKSCARF && type==PBTypes::NORMAL - atk=modatk if attacker.item==PBItems::BLACKBELT && type==PBTypes::FIGHTING - atk=modatk if attacker.item==PBItems::SHARPBEAK && type==PBTypes::FLYING - atk=modatk if attacker.item==PBItems::POISONBARB && type==PBTypes::POISON - atk=modatk if attacker.item==PBItems::SOFTSAND && type==PBTypes::GROUND - atk=modatk if attacker.item==PBItems::HARDSTONE && type==PBTypes::ROCK - atk=modatk if attacker.item==PBItems::SILVERPOWDER && type==PBTypes::BUG - atk=modatk if attacker.item==PBItems::SPELLTAG && type==PBTypes::GHOST - atk=modatk if attacker.item==PBItems::METALCOAT && type==PBTypes::STEEL - spatk=modspatk if attacker.item==PBItems::CHARCOAL && type==PBTypes::FIRE - spatk=modspatk if attacker.item==PBItems::MYSTICWATER && type==PBTypes::WATER - spatk=modspatk if attacker.item==PBItems::MIRACLESEED && type==PBTypes::GRASS - spatk=modspatk if attacker.item==PBItems::MAGNET && type==PBTypes::ELECTRIC - spatk=modspatk if attacker.item==PBItems::TWISTEDSPOON && type==PBTypes::PSYCHIC - spatk=modspatk if attacker.item==PBItems::NEVERMELTICE && type==PBTypes::ICE - spatk=modspatk if attacker.item==PBItems::DRAGONFANG && type==PBTypes::DRAGON - spatk=modspatk if attacker.item==PBItems::BLACKGLASSES && type==PBTypes::DARK - if attacker.item==PBItems::SEAINCENSE&&type==PBTypes::WATER + atk=modatk if isConst?(attacker.item,PBItems,:SILKSCARF) && type==PBTypes::NORMAL + atk=modatk if isConst?(attacker.item,PBItems,:BLACKBELT) && type==PBTypes::FIGHTING + atk=modatk if isConst?(attacker.item,PBItems,:SHARPBEAK) && type==PBTypes::FLYING + atk=modatk if isConst?(attacker.item,PBItems,:POISONBARB) && type==PBTypes::POISON + atk=modatk if isConst?(attacker.item,PBItems,:SOFTSAND) && type==PBTypes::GROUND + atk=modatk if isConst?(attacker.item,PBItems,:HARDSTONE) && type==PBTypes::ROCK + atk=modatk if isConst?(attacker.item,PBItems,:SILVERPOWDER) && type==PBTypes::BUG + atk=modatk if isConst?(attacker.item,PBItems,:SPELLTAG) && type==PBTypes::GHOST + atk=modatk if isConst?(attacker.item,PBItems,:METALCOAT) && type==PBTypes::STEEL + spatk=modspatk if isConst?(attacker.item,PBItems,:CHARCOAL) && type==PBTypes::FIRE + spatk=modspatk if isConst?(attacker.item,PBItems,:MYSTICWATER) && type==PBTypes::WATER + spatk=modspatk if isConst?(attacker.item,PBItems,:MIRACLESEED) && type==PBTypes::GRASS + spatk=modspatk if isConst?(attacker.item,PBItems,:MAGNET) && type==PBTypes::ELECTRIC + spatk=modspatk if isConst?(attacker.item,PBItems,:TWISTEDSPOON) && type==PBTypes::PSYCHIC + spatk=modspatk if isConst?(attacker.item,PBItems,:NEVERMELTICE) && type==PBTypes::ICE + spatk=modspatk if isConst?(attacker.item,PBItems,:DRAGONFANG) && type==PBTypes::DRAGON + spatk=modspatk if isConst?(attacker.item,PBItems,:BLACKGLASSES) && type==PBTypes::DARK + if isConst?(attacker.item,PBItems,:SEAINCENSE)&&type==PBTypes::WATER spatk=(spatk*1.05).floor end - atk=(atk*1.5).floor if attacker.item==PBItems::CHOICEBAND - if isConst?(attacker.species,PBSpecies,:CLAMPERL)&&attacker.item==PBItems::DEEPSEATOOTH + atk=(atk*1.5).floor if isConst?(attacker.item,PBItems,:CHOICEBAND) + if isConst?(attacker.species,PBSpecies,:CLAMPERL)&&isConst?(attacker.item,PBItems,:DEEPSEATOOTH) spatk*=2 end - if isConst?(attacker.species,PBSpecies,:PIKACHU)&&attacker.item==PBItems::LIGHTBALL + if isConst?(attacker.species,PBSpecies,:PIKACHU)&&isConst?(attacker.item,PBItems,:LIGHTBALL) spatk*=2 end if (isConst?(attacker.species,PBSpecies,:CUBONE)|| isConst?(attacker.species,PBSpecies,:MAROWAK))&& - attacker.item==PBItems::THICKCLUB + isConst?(attacker.item,PBItems,:THICKCLUB) atk*=2 end Changed: PokemonMart --- Left +++ Right @@ -455,6 +455,6 @@ $Trainer.money=0 if $Trainer.money<0 pbDisplayPaused(_INTL("Here you are!\r\nThank you!")) - if quantity>=10 && isConst?(item,PBItems,:POKéBALL) && hasConst?(PBItems,:PREMIERBALL) - if $PokemonBag.pbStoreItem(PBItems::PREMIERBALL) + if quantity>=10 && isConst?(item,PBItems,:POKeBALL) && hasConst?(PBItems,:PREMIERBALL) + if $PokemonBag.pbStoreItem(getConst(PBItems,:PREMIERBALL)) pbDisplayPaused(_INTL("I'll throw in a Premier Ball, too.")) end Changed: PokemonEncounters --- Left +++ Right @@ -120,5 +120,5 @@ end if $Trainer.party.length>0 - if $Trainer.party[0].item==PBItems::CLEANSETAG + if isConst?($Trainer.party[0].item,PBItems,:CLEANSETAG) encount=(encount*2/3) else Changed: Recognizer --- Left +++ Right @@ -38,108 +38,16 @@ [10,0,5,10] ]) ) -multistrokes.push( - -Multistroke.newCompact("U",useLimitedRotationInvariance,[ - -[177,80,177,114,177,148,177,182,179,216,183,249,190,282,215,305,248,309,270,291,280,258,291,226,302,194,313,161,324,129,335,97] - -])) - - - -multistrokes.push( - -Multistroke.newCompact("U",useLimitedRotationInvariance,[ - -[163,51,159,85,155,119,153,153,153,187,161,220,182,247,214,258,238,248,243,214,248,180,253,146,258,112,263,78] - -])) - -multistrokes.push( - -Multistroke.newCompact("V",useLimitedRotationInvariance,[ - -[147,66,161,97,180,126,199,155,216,185,233,215,242,247,261,229,278,199,296,169,313,139,331,109,348,80] - -])) - -multistrokes.push( - -Multistroke.newCompact("U",useLimitedRotationInvariance,[ - -[171,37,171,71,172,106,172,140,172,175,185,206,209,227,232,212,245,180,257,148,270,116,283,84,295,52] - -])) - -multistrokes.push( - -Multistroke.newCompact("U",useLimitedRotationInvariance,[ - -[133,65,133,98,133,132,133,166,137,199,155,226,187,238,210,224,219,192,228,159,237,127,247,94,255,63,257,88,259,121,261,155,268,188,274,221,281,254] - -])) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[161,80,168,80,222,84,337,104,361,106,361,105], - -[277,96,145,245,147,243] - -])) - -multistrokes.push( - -Multistroke.newCompact("T",useLimitedRotationInvariance,[ - -[254,87,257,94,259,159,237,266], - -[195,91,198,90,212,90,273,88,350,88,377,82] - -])) - -multistrokes.push( - -Multistroke.newCompact("Q",useLimitedRotationInvariance,[ - -[240,54,211,72,183,90,155,108,127,126,98,144,88,168,99,200,117,229,141,250,171,265,202,264,211,231,221,199,230,167,239,135,248,103,257,70,267,38,270,13,240,27,210,42], - -[245,150,245,154,268,185,308,231,362,286,381,293] - -])) - -multistrokes.push( +multistrokes.push(Multistroke.newCompact("U",useLimitedRotationInvariance,[[177,80,177,114,177,148,177,182,179,216,183,249,190,282,215,305,248,309,270,291,280,258,291,226,302,194,313,161,324,129,335,97]]));; multistrokes.push(Multistroke.newCompact("U",useLimitedRotationInvariance,[[163,51,159,85,155,119,153,153,153,187,161,220,182,247,214,258,238,248,243,214,248,180,253,146,258,112,263,78]]));; multistrokes.push(Multistroke.newCompact("V",useLimitedRotationInvariance,[[147,66,161,97,180,126,199,155,216,185,233,215,242,247,261,229,278,199,296,169,313,139,331,109,348,80]]));; multistrokes.push(Multistroke.newCompact("U",useLimitedRotationInvariance,[[171,37,171,71,172,106,172,140,172,175,185,206,209,227,232,212,245,180,257,148,270,116,283,84,295,52]]));; multistrokes.push(Multistroke.newCompact("U",useLimitedRotationInvariance,[[133,65,133,98,133,132,133,166,137,199,155,226,187,238,210,224,219,192,228,159,237,127,247,94,255,63,257,88,259,121,261,155,268,188,274,221,281,254]]));; multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[161,80,168,80,222,84,337,104,361,106,361,105],[277,96,145,245,147,243]]));; multistrokes.push(Multistroke.newCompact("T",useLimitedRotationInvariance,[[254,87,257,94,259,159,237,266],[195,91,198,90,212,90,273,88,350,88,377,82]]));; multistrokes.push(Multistroke.newCompact("Q",useLimitedRotationInvariance,[[240,54,211,72,183,90,155,108,127,126,98,144,88,168,99,200,117,229,141,250,171,265,202,264,211,231,221,199,230,167,239,135,248,103,257,70,267,38,270,13,240,27,210,42],[245,150,245,154,268,185,308,231,362,286,381,293]]));; multistrokes.push( Multistroke.newCompact("D", useLimitedRotationInvariance, [ [345,8,344,85], [350,6,360,6,375,8,387,13,396,25,399,38,399,55,396,66,387,76,377,82,365,85,353,86,346,86] ]) ); - - +multistrokes.push(Multistroke.newCompact("E",useLimitedRotationInvariance,[[138,59,134,81,131,103,127,125,126,148,125,170,124,193,123,215,129,232,151,232,174,232,197,232],[128,116,137,116,151,118,177,121,178,121,176,121],[139,65,144,65,149,65,154,63,159,62,164,62,169,62,174,62,179,62,184,62,189,61,195,60]]) ); multistrokes.push( - -Multistroke.newCompact("E",useLimitedRotationInvariance,[ - -[138,59,134,81,131,103,127,125,126,148,125,170,124,193,123,215,129,232,151,232,174,232,197,232], - -[128,116,137,116,151,118,177,121,178,121,176,121], - -[139,65,144,65,149,65,154,63,159,62,164,62,169,62,174,62,179,62,184,62,189,61,195,60] - -]) ) -multistrokes.push( Multistroke.newCompact("P", useLimitedRotationInvariance, [ [507,8,505,48,505,98], [510,6,518,6,538,7,553,12,561,24,561,37,552,46,539,51,522,54,514,54,508,54] ]) ); -multistrokes.push( - -Multistroke.newCompact("M",useLimitedRotationInvariance,[ - -[165,233,164,184,164,135,162,86,178,84,197,129,225,138,260,105,297,79,292,128,289,177,287,225] - -]) ) - -multistrokes.push( +multistrokes.push(Multistroke.newCompact("M",useLimitedRotationInvariance,[[165,233,164,184,164,135,162,86,178,84,197,129,225,138,260,105,297,79,292,128,289,177,287,225]]) );multistrokes.push( Multistroke.newCompact("N", useLimitedRotationInvariance, [ [0,10,0,0], @@ -147,896 +55,10 @@ [10,10,10,0] ]) ) -multistrokes.push( - -Multistroke.newCompact("O",useLimitedRotationInvariance,[ - -[270,65,231,64,209,97,197,136,205,174,238,196,276,207,311,190,329,155,317,118,293,87,259,70] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("O",useLimitedRotationInvariance,[ - -[324,88,291,55,247,40,203,53,170,84,165,130,192,166,237,179,283,182,321,156,340,114,318,75] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("R",useLimitedRotationInvariance,[ - -[206,45,206,65,206,85,206,105,206,125,208,145,209,165,211,185,214,205,218,225,222,245,226,264], - -[203,36,249,34,294,39,332,63,327,103,293,135,247,140,241,155,282,177,322,202,361,227,397,255] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Q",useLimitedRotationInvariance,[ - -[187,52,140,64,113,105,109,153,135,193,175,219,222,211,258,178,279,135,254,94,210,74,163,62], - -[208,156,228,176,254,205,254,205,290,241,291,242,289,241] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("S",useLimitedRotationInvariance,[ - -[294,64,258,43,217,33,180,43,177,81,214,99,255,110,283,136,263,167,224,183,185,170,159,144] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("T",useLimitedRotationInvariance,[ - -[210,81,209,98,209,115,210,132,211,149,213,166,214,183,216,200,217,217,219,234,220,251,224,268], - -[150,79,161,79,172,78,183,77,194,77,205,77,216,77,227,77,238,77,250,77,261,77,272,76] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[104,52,124,102,137,156,156,153,185,106,208,56,229,85,247,137,272,186,290,161,300,106,318,56] - -]) ) - -multistrokes.push( - - Multistroke.newCompact("X", useLimitedRotationInvariance, [ +multistrokes.push(Multistroke.newCompact("O",useLimitedRotationInvariance,[[270,65,231,64,209,97,197,136,205,174,238,196,276,207,311,190,329,155,317,118,293,87,259,70]]) );multistrokes.push(Multistroke.newCompact("O",useLimitedRotationInvariance,[[324,88,291,55,247,40,203,53,170,84,165,130,192,166,237,179,283,182,321,156,340,114,318,75]]) );multistrokes.push(Multistroke.newCompact("R",useLimitedRotationInvariance,[[206,45,206,65,206,85,206,105,206,125,208,145,209,165,211,185,214,205,218,225,222,245,226,264],[203,36,249,34,294,39,332,63,327,103,293,135,247,140,241,155,282,177,322,202,361,227,397,255]]) );multistrokes.push(Multistroke.newCompact("Q",useLimitedRotationInvariance,[[187,52,140,64,113,105,109,153,135,193,175,219,222,211,258,178,279,135,254,94,210,74,163,62],[208,156,228,176,254,205,254,205,290,241,291,242,289,241]]) );multistrokes.push(Multistroke.newCompact("S",useLimitedRotationInvariance,[[294,64,258,43,217,33,180,43,177,81,214,99,255,110,283,136,263,167,224,183,185,170,159,144]]) );multistrokes.push(Multistroke.newCompact("T",useLimitedRotationInvariance,[[210,81,209,98,209,115,210,132,211,149,213,166,214,183,216,200,217,217,219,234,220,251,224,268],[150,79,161,79,172,78,183,77,194,77,205,77,216,77,227,77,238,77,250,77,261,77,272,76]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[104,52,124,102,137,156,156,153,185,106,208,56,229,85,247,137,272,186,290,161,300,106,318,56]]) );multistrokes.push( Multistroke.newCompact("X", useLimitedRotationInvariance, [ [34,150,61,183,92,226], [86,151,61,183,30,225] ]) ); -multistrokes.push( - -Multistroke.newCompact("Y",useLimitedRotationInvariance,[ - -[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109], - -[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Z",useLimitedRotationInvariance,[ - -[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("G",useLimitedRotationInvariance,[ - -[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246], - -[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("C",true,[ - -[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261], - -[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[205,91,205,157,210,236,210,236,210,265,210,268,210,268], - -[214,90,214,90,226,90,247,89,278,89,295,89,295,89], - -[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("M",useLimitedRotationInvariance,[ - -[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("I",useLimitedRotationInvariance,[ - -[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77], - -[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300], - -[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67], - -[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("K",useLimitedRotationInvariance,[ - -[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275], - -[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87], - -[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("L",useLimitedRotationInvariance,[ - -[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("X",useLimitedRotationInvariance,[ - -[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278], - -[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Y",useLimitedRotationInvariance,[ - -[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109], - -[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Z",useLimitedRotationInvariance,[ - -[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("G",useLimitedRotationInvariance,[ - -[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246], - -[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("C",true,[ - -[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261], - -[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[205,91,205,157,210,236,210,236,210,265,210,268,210,268], - -[214,90,214,90,226,90,247,89,278,89,295,89,295,89], - -[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("M",useLimitedRotationInvariance,[ - -[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("I",useLimitedRotationInvariance,[ - -[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77], - -[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300], - -[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67], - -[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("K",useLimitedRotationInvariance,[ - -[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275], - -[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87], - -[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("L",useLimitedRotationInvariance,[ - -[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("X",useLimitedRotationInvariance,[ - -[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278], - -[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("N",useLimitedRotationInvariance,[ - -[150,195,150,155,153,116,154,76,163,64,177,100,190,138,201,174,216,158,221,119,223,79,229,42] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[288,95,245,115,203,136,161,157,129,184,151,224,195,237,233,226,252,183,271,140,290,96,278,76], - -[240,181,250,187,260,195,270,203,280,210,291,217,301,224,311,231,321,238,332,245,342,252,352,260] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[241,85,245,94,250,130,252,194,239,253], - -[240,70,240,72,242,73,270,73,305,65,308,65], - -[251,156,370,156,370,153] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("G",useLimitedRotationInvariance,[ - -[265,106,222,127,179,148,136,169,118,205,146,240,194,243,203,197,198,180,245,185,273,207,264,253] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[149,89,159,142,171,196,186,175,194,120,222,146,233,201,242,256,256,216,270,162,283,108,297,54] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Y",useLimitedRotationInvariance,[ - -[209,59,206,76,203,93,205,110,213,125,229,134,241,125,253,112,264,99,276,86,288,73,300,61], - -[230,135,232,143,234,158,235,205,237,247,239,264] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[151,55,155,59,156,96,142,254,144,275,145,276,143,276], - -[155,54,200,56,243,74,249,101,211,128,173,154,172,169,218,170,237,210,226,247,182,260,140,271] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("C",true,[ - -[284,111,262,134,241,157,220,180,198,204,188,231,195,261,216,284,244,275,271,259,298,243,326,228] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("H",useLimitedRotationInvariance,[ - -[185,52,187,92,196,279], - -[295,59,298,63,305,124,305,262,304,291,304,302], - -[194,163,255,163,282,160,304,160] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("N",useLimitedRotationInvariance,[ - -[128,250,133,189,139,128,145,68,162,93,188,148,221,199,257,248,269,223,272,162,275,101,281,43] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("O",useLimitedRotationInvariance,[ - -[295,82,241,104,187,126,134,148,132,197,164,245,209,281,266,288,272,238,270,180,267,122,265,65] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("S",useLimitedRotationInvariance,[ - -[295,79,245,69,196,60,147,51,173,82,220,96,270,100,307,129,300,164,250,159,200,154,151,150] - -]) ) -multistrokes.push( - -Multistroke.newCompact("Y",useLimitedRotationInvariance,[ - -[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109], - -[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Z",useLimitedRotationInvariance,[ - -[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("G",useLimitedRotationInvariance,[ - -[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246], - -[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("C",true,[ - -[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261], - -[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[205,91,205,157,210,236,210,236,210,265,210,268,210,268], - -[214,90,214,90,226,90,247,89,278,89,295,89,295,89], - -[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("M",useLimitedRotationInvariance,[ - -[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("I",useLimitedRotationInvariance,[ - -[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77], - -[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300], - -[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67], - -[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("K",useLimitedRotationInvariance,[ - -[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275], - -[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87], - -[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("L",useLimitedRotationInvariance,[ - -[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("X",useLimitedRotationInvariance,[ - -[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278], - -[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("N",useLimitedRotationInvariance,[ - -[150,195,150,155,153,116,154,76,163,64,177,100,190,138,201,174,216,158,221,119,223,79,229,42] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[288,95,245,115,203,136,161,157,129,184,151,224,195,237,233,226,252,183,271,140,290,96,278,76], - -[240,181,250,187,260,195,270,203,280,210,291,217,301,224,311,231,321,238,332,245,342,252,352,260] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("F",useLimitedRotationInvariance,[ - -[241,85,245,94,250,130,252,194,239,253], - -[240,70,240,72,242,73,270,73,305,65,308,65], - -[251,156,370,156,370,153] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("G",useLimitedRotationInvariance,[ - -[265,106,222,127,179,148,136,169,118,205,146,240,194,243,203,197,198,180,245,185,273,207,264,253] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("W",useLimitedRotationInvariance,[ - -[149,89,159,142,171,196,186,175,194,120,222,146,233,201,242,256,256,216,270,162,283,108,297,54] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Y",useLimitedRotationInvariance,[ - -[209,59,206,76,203,93,205,110,213,125,229,134,241,125,253,112,264,99,276,86,288,73,300,61], - -[230,135,232,143,234,158,235,205,237,247,239,264] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[151,55,155,59,156,96,142,254,144,275,145,276,143,276], - -[155,54,200,56,243,74,249,101,211,128,173,154,172,169,218,170,237,210,226,247,182,260,140,271] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("C",true,[ - -[284,111,262,134,241,157,220,180,198,204,188,231,195,261,216,284,244,275,271,259,298,243,326,228] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("H",useLimitedRotationInvariance,[ - -[185,52,187,92,196,279], - -[295,59,298,63,305,124,305,262,304,291,304,302], - -[194,163,255,163,282,160,304,160] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("N",useLimitedRotationInvariance,[ - -[128,250,133,189,139,128,145,68,162,93,188,148,221,199,257,248,269,223,272,162,275,101,281,43] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("O",useLimitedRotationInvariance,[ - -[295,82,241,104,187,126,134,148,132,197,164,245,209,281,266,288,272,238,270,180,267,122,265,65] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("S",useLimitedRotationInvariance,[ - -[295,79,245,69,196,60,147,51,173,82,220,96,270,100,307,129,300,164,250,159,200,154,151,150] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("E",useLimitedRotationInvariance,[ - -[152,71,156,93,157,118,157,142,157,166,156,190,156,214,156,238,166,253,190,255,214,255,238,255], - -[157,152,278,138], - -[157,73,159,73,330,52] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("A",useLimitedRotationInvariance,[ - -[120,235,133,199,146,164,160,129,173,93,191,81,207,115,220,150,229,187,237,224,251,259,261,288], - -[154,171,177,171,185,172,193,173,200,174,203,175,206,176] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[221,72,221,114,215,157,218,170,232,128,246,87,266,95,226,111,231,120,270,136,250,162,209,177] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("Q",useLimitedRotationInvariance,[ - -[229,53,199,70,170,87,141,104,112,121,97,145,106,177,127,204,155,223,186,235,220,242,217,212,212,178,206,145,200,111,194,78,189,45], - -[210,160,225,175,257,204,293,231,321,250] - -]) ) - -multistrokes.push( - -Multistroke.newCompact("B",useLimitedRotationInvariance,[ - -[144,64,148,89,148,208], - -[145,63,178,63,212,64,245,71,261,94,229,103,196,112,163,121,175,125,209,129,242,134,273,147,296,170,287,191,254,197,220,204,187,210] - -])) - -multistrokes.push( - -Multistroke.newCompact("C",useLimitedRotationInvariance,[ - -[293,84,259,95,226,107,193,118,160,130,134,145,149,175,174,199,207,199,240,186,272,173] - -])) - -multistrokes.push( - -Multistroke.newCompact("C",useLimitedRotationInvariance,[ - -[277,110,242,115,208,120,173,125,140,131,144,166,163,195,189,217,223,222,257,215,288,201,320,186] - -])) - -multistrokes.push( - -Multistroke.newCompact("C",useLimitedRotationInvariance,[ - -[230,73,203,95,176,117,149,140,123,162,96,184,69,207,83,228,118,233,153,233,186,228,216,210] - -])) - -multistrokes.push( - -Multistroke.newCompact("C",useLimitedRotationInvariance,[ - -[277,90,241,96,205,102,169,108,171,139,198,161,233,170,268,169] - -])) - -multistrokes.push( - -Multistroke.newCompact("N",useLimitedRotationInvariance,[ - -[208,177,213,100,243,168,261,205,283,236,283,251,306,83] - -])) - -multistrokes.push( - -Multistroke.newCompact("J",useLimitedRotationInvariance,[ - -[161,80,168,80,222,84,337,104,361,106,361,105], - -[277,96,145,245,147,243] - -])) - -multistrokes.push( - -Multistroke.newCompact("T",useLimitedRotationInvariance,[ - -[254,87,257,94,259,159,237,266], - -[195,91,198,90,212,90,273,88,350,88,377,82] - -])) - - - -multistrokes.push( - -Multistroke.newCompact("T",useLimitedRotationInvariance,[ - -[254,87,257,94,259,159,237,266], - -[195,91,198,90,212,90,273,88,350,88,377,82] - -])) - -multistrokes.push( - -Multistroke.newCompact("Q",useLimitedRotationInvariance,[ - -[240,54,211,72,183,90,155,108,127,126,98,144,88,168,99,200,117,229,141,250,171,265,202,264,211,231,221,199,230,167,239,135,248,103,257,70,267,38,270,13,240,27,210,42], - -[245,150,245,154,268,185,308,231,362,286,381,293] - -])) - - - -multistrokes.push( - -Multistroke.newCompact("S",useLimitedRotationInvariance,[ - -[222,147,169,149,170,158,242,202,281,254,195,248] - -])) - -multistrokes.push( - -Multistroke.newCompact("S",useLimitedRotationInvariance,[ - -[248,149,211,153,220,167,240,177,259,186,264,215,192,198] - -])) - -multistrokes.push( - -Multistroke.newCompact("M",useLimitedRotationInvariance,[ - -[151,259,171,226,194,241,221,222,241,221] - -])) - -multistrokes.push( - -Multistroke.newCompact("A",useLimitedRotationInvariance,[ - -[206,234,217,201,228,168,238,135,249,102,260,69,271,35,294,48,298,81,299,116,299,151,298,186], - -[212,151,212,150,319,150] - -])) - -multistrokes.push( - -Multistroke.newCompact("A",useLimitedRotationInvariance,[ - -[145,86,144,119,143,153,142,187,142,221,150,208,161,176,173,144,184,112,195,80,206,48,228,55,243,84,248,117,246,150,238,183,230,216], - -[97,147,102,149,158,159,223,176,263,187] - -])) - - +multistrokes.push(Multistroke.newCompact("Y",useLimitedRotationInvariance,[[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109],[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276]]) );multistrokes.push(Multistroke.newCompact("Z",useLimitedRotationInvariance,[[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218]]) );multistrokes.push(Multistroke.newCompact("G",useLimitedRotationInvariance,[[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246],[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231]]) );multistrokes.push(Multistroke.newCompact("C",true,[[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261],[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[205,91,205,157,210,236,210,236,210,265,210,268,210,268],[214,90,214,90,226,90,247,89,278,89,295,89,295,89],[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175]]) );multistrokes.push(Multistroke.newCompact("M",useLimitedRotationInvariance,[[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254]]) );multistrokes.push(Multistroke.newCompact("I",useLimitedRotationInvariance,[[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77],[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300],[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67],[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191]]) );multistrokes.push(Multistroke.newCompact("K",useLimitedRotationInvariance,[[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275],[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87],[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259]]) );multistrokes.push(Multistroke.newCompact("L",useLimitedRotationInvariance,[[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46]]) );multistrokes.push(Multistroke.newCompact("X",useLimitedRotationInvariance,[[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278],[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260]]) );multistrokes.push(Multistroke.newCompact("Y",useLimitedRotationInvariance,[[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109],[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276]]) );multistrokes.push(Multistroke.newCompact("Z",useLimitedRotationInvariance,[[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218]]) );multistrokes.push(Multistroke.newCompact("G",useLimitedRotationInvariance,[[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246],[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231]]) );multistrokes.push(Multistroke.newCompact("C",true,[[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261],[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[205,91,205,157,210,236,210,236,210,265,210,268,210,268],[214,90,214,90,226,90,247,89,278,89,295,89,295,89],[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175]]) );multistrokes.push(Multistroke.newCompact("M",useLimitedRotationInvariance,[[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254]]) );multistrokes.push(Multistroke.newCompact("I",useLimitedRotationInvariance,[[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77],[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300],[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67],[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191]]) );multistrokes.push(Multistroke.newCompact("K",useLimitedRotationInvariance,[[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275],[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87],[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259]]) );multistrokes.push(Multistroke.newCompact("L",useLimitedRotationInvariance,[[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46]]) );multistrokes.push(Multistroke.newCompact("X",useLimitedRotationInvariance,[[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278],[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260]]) );multistrokes.push(Multistroke.newCompact("N",useLimitedRotationInvariance,[[150,195,150,155,153,116,154,76,163,64,177,100,190,138,201,174,216,158,221,119,223,79,229,42]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[288,95,245,115,203,136,161,157,129,184,151,224,195,237,233,226,252,183,271,140,290,96,278,76],[240,181,250,187,260,195,270,203,280,210,291,217,301,224,311,231,321,238,332,245,342,252,352,260]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[241,85,245,94,250,130,252,194,239,253],[240,70,240,72,242,73,270,73,305,65,308,65],[251,156,370,156,370,153]]) );multistrokes.push(Multistroke.newCompact("G",useLimitedRotationInvariance,[[265,106,222,127,179,148,136,169,118,205,146,240,194,243,203,197,198,180,245,185,273,207,264,253]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[149,89,159,142,171,196,186,175,194,120,222,146,233,201,242,256,256,216,270,162,283,108,297,54]]) );multistrokes.push(Multistroke.newCompact("Y",useLimitedRotationInvariance,[[209,59,206,76,203,93,205,110,213,125,229,134,241,125,253,112,264,99,276,86,288,73,300,61],[230,135,232,143,234,158,235,205,237,247,239,264]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[151,55,155,59,156,96,142,254,144,275,145,276,143,276],[155,54,200,56,243,74,249,101,211,128,173,154,172,169,218,170,237,210,226,247,182,260,140,271]]) );multistrokes.push(Multistroke.newCompact("C",true,[[284,111,262,134,241,157,220,180,198,204,188,231,195,261,216,284,244,275,271,259,298,243,326,228]]) );multistrokes.push(Multistroke.newCompact("H",useLimitedRotationInvariance,[[185,52,187,92,196,279],[295,59,298,63,305,124,305,262,304,291,304,302],[194,163,255,163,282,160,304,160]]) );multistrokes.push(Multistroke.newCompact("N",useLimitedRotationInvariance,[[128,250,133,189,139,128,145,68,162,93,188,148,221,199,257,248,269,223,272,162,275,101,281,43]]) );multistrokes.push(Multistroke.newCompact("O",useLimitedRotationInvariance,[[295,82,241,104,187,126,134,148,132,197,164,245,209,281,266,288,272,238,270,180,267,122,265,65]]) );multistrokes.push(Multistroke.newCompact("S",useLimitedRotationInvariance,[[295,79,245,69,196,60,147,51,173,82,220,96,270,100,307,129,300,164,250,159,200,154,151,150]]) ); +multistrokes.push(Multistroke.newCompact("Y",useLimitedRotationInvariance,[[173,65,190,84,204,105,218,127,231,150,243,173,252,197,261,178,279,160,300,145,321,129,335,109],[250,187,253,194,253,203,253,212,253,220,253,229,253,237,253,246,253,254,253,263,254,271,253,276]]) );multistrokes.push(Multistroke.newCompact("Z",useLimitedRotationInvariance,[[191,75,239,85,288,93,337,102,315,119,272,145,230,172,197,208,228,221,278,220,328,219,374,218]]) );multistrokes.push(Multistroke.newCompact("G",useLimitedRotationInvariance,[[325,124,279,111,239,136,217,180,214,229,241,267,289,274,318,238,295,198,275,195,324,191,368,190]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[223,91,220,104,219,119,219,133,219,147,219,162,219,176,219,190,220,205,222,219,227,232,231,246],[227,95,269,95,307,107,297,146,257,155,220,160,262,160,304,164,332,191,316,224,276,232,234,231]]) );multistrokes.push(Multistroke.newCompact("C",true,[[353,103,318,69,266,62,217,76,181,112,172,163,168,214,181,265,224,292,276,300,327,297,370,283]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[342,75,314,75,287,75,260,73,235,72,235,99,235,126,235,153,235,181,235,208,235,235,238,261],[238,168,246,168,254,167,262,167,270,166,278,166,286,165,294,165,302,165,310,165,318,165,322,164]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[205,91,205,157,210,236,210,236,210,265,210,268,210,268],[214,90,214,90,226,90,247,89,278,89,295,89,295,89],[209,176,214,176,220,176,226,176,232,176,238,175,243,175,249,175,255,175,261,175,267,175,271,175]]) );multistrokes.push(Multistroke.newCompact("M",useLimitedRotationInvariance,[[178,231,193,173,210,116,224,117,241,174,269,227,293,205,316,150,333,94,348,138,358,197,372,254]]) );multistrokes.push(Multistroke.newCompact("I",useLimitedRotationInvariance,[[191,62,204,62,218,62,231,63,245,64,258,65,272,67,286,68,299,70,313,72,326,75,338,77],[279,73,281,93,280,113,278,134,277,155,275,175,274,196,272,217,271,237,270,258,270,279,270,300],[209,289,222,290,236,289,250,289,264,288,278,288,291,288,305,288,319,288,333,288,347,288,355,288]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[240,64,254,64,269,64,284,64,298,64,313,65,328,65,343,66,357,67,372,67,387,67,401,67],[340,68,340,100,340,133,340,166,340,199,340,232,340,264,331,293,299,296,267,288,236,279,210,262]]) );multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[323,63,317,95,313,129,312,162,312,195,307,228,298,260,272,279,239,273,214,253,203,222,204,191]]) );multistrokes.push(Multistroke.newCompact("K",useLimitedRotationInvariance,[[224,53,224,73,224,93,224,113,224,133,224,153,224,174,224,194,224,214,225,234,227,254,228,275],[229,206,241,194,254,184,267,175,280,165,293,155,306,145,317,133,329,122,341,110,352,99,364,87],[275,169,281,177,287,185,294,193,300,201,306,209,312,218,318,226,324,235,331,243,337,251,345,259]]) );multistrokes.push(Multistroke.newCompact("L",useLimitedRotationInvariance,[[230,95,230,128,231,161,233,195,235,228,237,261,240,291,273,285,306,282,340,282,373,281,407,280]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[132,65,148,145,182,221,224,246,266,175,291,96,297,69,312,150,343,227,384,205,407,126,410,46]]) );multistrokes.push(Multistroke.newCompact("X",useLimitedRotationInvariance,[[180,88,193,103,206,118,218,135,227,153,236,171,245,189,255,207,264,225,273,243,282,261,293,278],[340,68,321,82,302,98,284,113,266,129,251,147,238,168,225,188,209,206,193,223,174,239,167,260]]) );multistrokes.push(Multistroke.newCompact("N",useLimitedRotationInvariance,[[150,195,150,155,153,116,154,76,163,64,177,100,190,138,201,174,216,158,221,119,223,79,229,42]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[288,95,245,115,203,136,161,157,129,184,151,224,195,237,233,226,252,183,271,140,290,96,278,76],[240,181,250,187,260,195,270,203,280,210,291,217,301,224,311,231,321,238,332,245,342,252,352,260]]) );multistrokes.push(Multistroke.newCompact("F",useLimitedRotationInvariance,[[241,85,245,94,250,130,252,194,239,253],[240,70,240,72,242,73,270,73,305,65,308,65],[251,156,370,156,370,153]]) );multistrokes.push(Multistroke.newCompact("G",useLimitedRotationInvariance,[[265,106,222,127,179,148,136,169,118,205,146,240,194,243,203,197,198,180,245,185,273,207,264,253]]) );multistrokes.push(Multistroke.newCompact("W",useLimitedRotationInvariance,[[149,89,159,142,171,196,186,175,194,120,222,146,233,201,242,256,256,216,270,162,283,108,297,54]]) );multistrokes.push(Multistroke.newCompact("Y",useLimitedRotationInvariance,[[209,59,206,76,203,93,205,110,213,125,229,134,241,125,253,112,264,99,276,86,288,73,300,61],[230,135,232,143,234,158,235,205,237,247,239,264]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[151,55,155,59,156,96,142,254,144,275,145,276,143,276],[155,54,200,56,243,74,249,101,211,128,173,154,172,169,218,170,237,210,226,247,182,260,140,271]]) );multistrokes.push(Multistroke.newCompact("C",true,[[284,111,262,134,241,157,220,180,198,204,188,231,195,261,216,284,244,275,271,259,298,243,326,228]]) );multistrokes.push(Multistroke.newCompact("H",useLimitedRotationInvariance,[[185,52,187,92,196,279],[295,59,298,63,305,124,305,262,304,291,304,302],[194,163,255,163,282,160,304,160]]) );multistrokes.push(Multistroke.newCompact("N",useLimitedRotationInvariance,[[128,250,133,189,139,128,145,68,162,93,188,148,221,199,257,248,269,223,272,162,275,101,281,43]]) );multistrokes.push(Multistroke.newCompact("O",useLimitedRotationInvariance,[[295,82,241,104,187,126,134,148,132,197,164,245,209,281,266,288,272,238,270,180,267,122,265,65]]) );multistrokes.push(Multistroke.newCompact("S",useLimitedRotationInvariance,[[295,79,245,69,196,60,147,51,173,82,220,96,270,100,307,129,300,164,250,159,200,154,151,150]]) );multistrokes.push(Multistroke.newCompact("E",useLimitedRotationInvariance,[[152,71,156,93,157,118,157,142,157,166,156,190,156,214,156,238,166,253,190,255,214,255,238,255],[157,152,278,138],[157,73,159,73,330,52]]) );multistrokes.push(Multistroke.newCompact("A",useLimitedRotationInvariance,[[120,235,133,199,146,164,160,129,173,93,191,81,207,115,220,150,229,187,237,224,251,259,261,288],[154,171,177,171,185,172,193,173,200,174,203,175,206,176]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[221,72,221,114,215,157,218,170,232,128,246,87,266,95,226,111,231,120,270,136,250,162,209,177]]) );multistrokes.push(Multistroke.newCompact("Q",useLimitedRotationInvariance,[[229,53,199,70,170,87,141,104,112,121,97,145,106,177,127,204,155,223,186,235,220,242,217,212,212,178,206,145,200,111,194,78,189,45],[210,160,225,175,257,204,293,231,321,250]]) );multistrokes.push(Multistroke.newCompact("B",useLimitedRotationInvariance,[[144,64,148,89,148,208],[145,63,178,63,212,64,245,71,261,94,229,103,196,112,163,121,175,125,209,129,242,134,273,147,296,170,287,191,254,197,220,204,187,210]]));; multistrokes.push(Multistroke.newCompact("C",useLimitedRotationInvariance,[[293,84,259,95,226,107,193,118,160,130,134,145,149,175,174,199,207,199,240,186,272,173]]));; multistrokes.push(Multistroke.newCompact("C",useLimitedRotationInvariance,[[277,110,242,115,208,120,173,125,140,131,144,166,163,195,189,217,223,222,257,215,288,201,320,186]]));; multistrokes.push(Multistroke.newCompact("C",useLimitedRotationInvariance,[[230,73,203,95,176,117,149,140,123,162,96,184,69,207,83,228,118,233,153,233,186,228,216,210]]));; multistrokes.push(Multistroke.newCompact("C",useLimitedRotationInvariance,[[277,90,241,96,205,102,169,108,171,139,198,161,233,170,268,169]]));; multistrokes.push(Multistroke.newCompact("N",useLimitedRotationInvariance,[[208,177,213,100,243,168,261,205,283,236,283,251,306,83]]));; multistrokes.push(Multistroke.newCompact("J",useLimitedRotationInvariance,[[161,80,168,80,222,84,337,104,361,106,361,105],[277,96,145,245,147,243]]));; multistrokes.push(Multistroke.newCompact("T",useLimitedRotationInvariance,[[254,87,257,94,259,159,237,266],[195,91,198,90,212,90,273,88,350,88,377,82]]));; multistrokes.push(Multistroke.newCompact("T",useLimitedRotationInvariance,[[254,87,257,94,259,159,237,266],[195,91,198,90,212,90,273,88,350,88,377,82]]));; multistrokes.push(Multistroke.newCompact("Q",useLimitedRotationInvariance,[[240,54,211,72,183,90,155,108,127,126,98,144,88,168,99,200,117,229,141,250,171,265,202,264,211,231,221,199,230,167,239,135,248,103,257,70,267,38,270,13,240,27,210,42],[245,150,245,154,268,185,308,231,362,286,381,293]]));; multistrokes.push(Multistroke.newCompact("S",useLimitedRotationInvariance,[[222,147,169,149,170,158,242,202,281,254,195,248]]));; multistrokes.push(Multistroke.newCompact("S",useLimitedRotationInvariance,[[248,149,211,153,220,167,240,177,259,186,264,215,192,198]]));; multistrokes.push(Multistroke.newCompact("M",useLimitedRotationInvariance,[[151,259,171,226,194,241,221,222,241,221]]));; multistrokes.push(Multistroke.newCompact("A",useLimitedRotationInvariance,[[206,234,217,201,228,168,238,135,249,102,260,69,271,35,294,48,298,81,299,116,299,151,298,186],[212,151,212,150,319,150]]));; multistrokes.push(Multistroke.newCompact("A",useLimitedRotationInvariance,[[145,86,144,119,143,153,142,187,142,221,150,208,161,176,173,144,184,112,195,80,206,48,228,55,243,84,248,117,246,150,238,183,230,216],[97,147,102,149,158,159,223,176,263,187]])); end @@ -1100,5 +122,5 @@ newStroke=[] i=0;while i0 - return PBItems::SAFARIBALL + return getConst(PBItems,:SAFARIBALL) || -1 end def pbCommandMenu(i) Changed: PokemonOrgBattle --- Left +++ Right @@ -52,10 +52,12 @@ insp=str.gsub(/^\s+/,"").gsub(/\s+$/,"") pieces=insp.split(/\s*;\s*/) - if constDef?(PBSpecies,pieces[0]) + species=1 + if hasConst?(PBSpecies,pieces[0]) species=PBSpecies.const_get(pieces[0]) - else - species=1 end - item=pieces[1]=="" ? 0 : PBItems.const_get(pieces[1]) + item=0 + if hasConst?(PBItems,pieces[1]) + item=PBItems.const_get(pieces[1]) + end nature=PBNatures.const_get(pieces[2]) ev=pieces[3].split(/\s*,\s*/) @@ -74,12 +76,11 @@ moveid=[] for i in 0...4 - if !moves[i]||moves[i]=="" - moveid[i]=0 - else - moveid[i]=PBMoves.const_get(moves[i]) + if hasConst?(PBMoves,moves[i]) + moveid.push(PBMoves.const_get(moves[i])) end end + moveid=[1] if moveid.length==0 return self.new(species,item,nature, - moveid[0],moveid[1],moveid[2],moveid[3],evvalue + moveid[0],(moveid[1]||0),(moveid[2]||0),(moveid[3]||0),evvalue ) end