Deleted rubyscreen.dll, eradicated semicolons from when... statements, compiling is now before setting up the system, appeased vocal dissenters

This commit is contained in:
Maruno17
2020-11-26 21:10:45 +00:00
parent 017cdb8d0f
commit eb22e49d9b
73 changed files with 905 additions and 817 deletions

View File

@@ -565,14 +565,26 @@ def pbFacingTileRegular(direction=nil,event=nil)
y = event.y
direction = event.direction if !direction
case direction
when 1; y += 1; x -= 1
when 2; y += 1
when 3; y += 1; x += 1
when 4; x -= 1
when 6; x += 1
when 7; y -= 1; x -= 1
when 8; y -= 1
when 9; y -= 1; x += 1
when 1
y += 1
x -= 1
when 2
y += 1
when 3
y += 1
x += 1
when 4
x -= 1
when 6
x += 1
when 7
y -= 1
x -= 1
when 8
y -= 1
when 9
y -= 1
x += 1
end
return [$game_map.map_id,x,y]
end
@@ -652,10 +664,10 @@ module InterpreterFieldMixin
# tiles that are passable only from certain directions
return if !event.passableStrict?(event.x,event.y,$game_player.direction)
case $game_player.direction
when 2; event.move_down # down
when 4; event.move_left # left
when 6; event.move_right # right
when 8; event.move_up # up
when 2 then event.move_down
when 4 then event.move_left
when 6 then event.move_right
when 8 then event.move_up
end
$PokemonMap.addMovedEvent(@event_id) if $PokemonMap
if oldx!=event.x || oldy!=event.y
@@ -1098,10 +1110,10 @@ def pbJumpToward(dist=1,playSound=false,cancelSurf=false)
x = $game_player.x
y = $game_player.y
case $game_player.direction
when 2; $game_player.jump(0,dist) # down
when 4; $game_player.jump(-dist,0) # left
when 6; $game_player.jump(dist,0) # right
when 8; $game_player.jump(0,-dist) # up
when 2 then $game_player.jump(0, dist) # down
when 4 then $game_player.jump(-dist, 0) # left
when 6 then $game_player.jump(dist, 0) # right
when 8 then $game_player.jump(0, -dist) # up
end
if $game_player.x!=x || $game_player.y!=y
pbSEPlay("Player jump") if playSound
@@ -1276,10 +1288,18 @@ def pbSetEscapePoint
xco = $game_player.x
yco = $game_player.y
case $game_player.direction
when 2; yco -= 1; dir = 8 # Down
when 4; xco += 1; dir = 6 # Left
when 6; xco -= 1; dir = 4 # Right
when 8; yco += 1; dir = 2 # Up
when 2 # Down
yco -= 1
dir = 8
when 4 # Left
xco += 1
dir = 6
when 6 # Right
xco -= 1
dir = 4
when 8 # Up
yco += 1
dir = 2
end
$PokemonGlobal.escapePoint = [$game_map.map_id,xco,yco,dir]
end

View File

@@ -703,10 +703,10 @@ end
def pbScrollMap(direction,distance,speed)
if speed==0
case direction
when 2; $game_map.scroll_down(distance * Game_Map::REAL_RES_Y)
when 4; $game_map.scroll_left(distance * Game_Map::REAL_RES_X)
when 6; $game_map.scroll_right(distance * Game_Map::REAL_RES_X)
when 8; $game_map.scroll_up(distance * Game_Map::REAL_RES_Y)
when 2 then $game_map.scroll_down(distance * Game_Map::REAL_RES_Y)
when 4 then $game_map.scroll_left(distance * Game_Map::REAL_RES_X)
when 6 then $game_map.scroll_right(distance * Game_Map::REAL_RES_X)
when 8 then $game_map.scroll_up(distance * Game_Map::REAL_RES_Y)
end
else
$game_map.start_scroll(direction, distance, speed)

View File

@@ -206,11 +206,11 @@ module RPG
@sprites.each { |s| s.dispose }
@sprites.clear
return
when PBFieldWeather::Rain; prepareRainBitmap
when PBFieldWeather::HeavyRain, PBFieldWeather::Storm; prepareStormBitmap
when PBFieldWeather::Snow; prepareSnowBitmaps
when PBFieldWeather::Blizzard; prepareBlizzardBitmaps
when PBFieldWeather::Sandstorm; prepareSandstormBitmaps
when PBFieldWeather::Rain then prepareRainBitmap
when PBFieldWeather::HeavyRain, PBFieldWeather::Storm then prepareStormBitmap
when PBFieldWeather::Snow then prepareSnowBitmaps
when PBFieldWeather::Blizzard then prepareBlizzardBitmaps
when PBFieldWeather::Sandstorm then prepareSandstormBitmaps
end
weatherBitmaps = (@type==PBFieldWeather::None || @type==PBFieldWeather::Sun) ? nil : @weatherTypes[@type][0]
ensureSprites
@@ -226,13 +226,13 @@ module RPG
# @max is (power+1)*4, where power is between 1 and 9
# Set tone of viewport (general screen brightening/darkening)
case @type
when PBFieldWeather::None; @viewport.tone.set(0,0,0,0)
when PBFieldWeather::Rain; @viewport.tone.set(-@max*3/4, -@max*3/4, -@max*3/4, 10)
when PBFieldWeather::HeavyRain; @viewport.tone.set(-@max*6/4, -@max*6/4, -@max*6/4, 20)
when PBFieldWeather::Storm; @viewport.tone.set(-@max*6/4, -@max*6/4, -@max*6/4, 20)
when PBFieldWeather::Snow; @viewport.tone.set( @max/2, @max/2, @max/2, 0)
when PBFieldWeather::Blizzard; @viewport.tone.set( @max*3/4, @max*3/4, max*3/4, 0)
when PBFieldWeather::Sandstorm; @viewport.tone.set( @max/2, 0, -@max/2, 0)
when PBFieldWeather::None then @viewport.tone.set(0, 0, 0, 0)
when PBFieldWeather::Rain then @viewport.tone.set(-@max * 3 / 4, -@max * 3 / 4, -@max * 3 / 4, 10)
when PBFieldWeather::HeavyRain then @viewport.tone.set(-@max * 6 / 4, -@max * 6 / 4, -@max * 6 / 4, 20)
when PBFieldWeather::Storm then @viewport.tone.set(-@max * 6 / 4, -@max * 6 / 4, -@max * 6 / 4, 20)
when PBFieldWeather::Snow then @viewport.tone.set( @max / 2, @max / 2, @max / 2, 0)
when PBFieldWeather::Blizzard then @viewport.tone.set( @max * 3 / 4, @max * 3 / 4, max * 3 / 4, 0)
when PBFieldWeather::Sandstorm then @viewport.tone.set( @max / 2, 0, -@max / 2, 0)
when PBFieldWeather::Sun
@sun = @max if @sun!=@max && @sun!=-@max
@sun = -@sun if @sunValue>@max || @sunValue<0

View File

@@ -182,10 +182,10 @@ class PokemonMapMetadata
next if !$game_map.events[i[0][1]]
$game_map.events[i[0][1]].moveto(i[1][0],i[1][1])
case i[1][2]
when 2; $game_map.events[i[0][1]].turn_down
when 4; $game_map.events[i[0][1]].turn_left
when 6; $game_map.events[i[0][1]].turn_right
when 8; $game_map.events[i[0][1]].turn_up
when 2 then $game_map.events[i[0][1]].turn_down
when 4 then $game_map.events[i[0][1]].turn_left
when 6 then $game_map.events[i[0][1]].turn_right
when 8 then $game_map.events[i[0][1]].turn_up
end
end
if i[1][3]!=nil

View File

@@ -30,26 +30,26 @@ class PokemonTemp
when "single", "1v1", "1v2", "2v1", "1v3", "3v1",
"double", "2v2", "2v3", "3v2", "triple", "3v3"
rules["size"] = rule.to_s.downcase
when "canlose"; rules["canLose"] = true
when "cannotlose"; rules["canLose"] = false
when "canrun"; rules["canRun"] = true
when "cannotrun"; rules["canRun"] = false
when "roamerflees"; rules["roamerFlees"] = true
when "noexp"; rules["expGain"] = false
when "nomoney"; rules["moneyGain"] = false
when "switchstyle"; rules["switchStyle"] = true
when "setstyle"; rules["switchStyle"] = false
when "anims"; rules["battleAnims"] = true
when "noanims"; rules["battleAnims"] = false
when "terrain"; rules["defaultTerrain"] = getID(PBBattleTerrains,var)
when "weather"; rules["defaultWeather"] = getID(PBWeather,var)
when "environment", "environ"; rules["environment"] = getID(PBEnvironment,var)
when "backdrop", "battleback"; rules["backdrop"] = var
when "base"; rules["base"] = var
when "outcome", "outcomevar"; rules["outcomeVar"] = var
when "nopartner"; rules["noPartner"] = true
when "canlose" then rules["canLose"] = true
when "cannotlose" then rules["canLose"] = false
when "canrun" then rules["canRun"] = true
when "cannotrun" then rules["canRun"] = false
when "roamerflees" then rules["roamerFlees"] = true
when "noexp" then rules["expGain"] = false
when "nomoney" then rules["moneyGain"] = false
when "switchstyle" then rules["switchStyle"] = true
when "setstyle" then rules["switchStyle"] = false
when "anims" then rules["battleAnims"] = true
when "noanims" then rules["battleAnims"] = false
when "terrain" then rules["defaultTerrain"] = getID(PBBattleTerrains, var)
when "weather" then rules["defaultWeather"] = getID(PBWeather, var)
when "environment", "environ" then rules["environment"] = getID(PBEnvironment, var)
when "backdrop", "battleback" then rules["backdrop"] = var
when "base" then rules["base"] = var
when "outcome", "outcomevar" then rules["outcomeVar"] = var
when "nopartner" then rules["noPartner"] = true
else
raise _INTL("Battle rule \"{1}\" does not exist.",rule)
raise _INTL("Battle rule \"{1}\" does not exist.", rule)
end
end
end
@@ -140,12 +140,18 @@ def pbPrepareBattle(battle)
if battleRules["base"].nil?
case battle.environment
when PBEnvironment::Grass, PBEnvironment::TallGrass,
PBEnvironment::ForestGrass; base = "grass"
# when PBEnvironment::Rock; base = "rock"
when PBEnvironment::Sand; base = "sand"
when PBEnvironment::MovingWater, PBEnvironment::StillWater; base = "water"
when PBEnvironment::Puddle; base = "puddle"
when PBEnvironment::Ice; base = "ice"
PBEnvironment::ForestGrass
base = "grass"
# when PBEnvironment::Rock
# base = "rock"
when PBEnvironment::Sand
base = "sand"
when PBEnvironment::MovingWater, PBEnvironment::StillWater
base = "water"
when PBEnvironment::Puddle
base = "puddle"
when PBEnvironment::Ice
base = "ice"
end
else
base = battleRules["base"]
@@ -168,24 +174,24 @@ end
def pbGetEnvironment
ret = GameData::MapMetadata.get($game_map.map_id).battle_environment
ret = PBEnvironment::None if !ret
if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
$PokemonTemp.encounterType==EncounterTypes::SuperRod
if $PokemonTemp.encounterType == EncounterTypes::OldRod ||
$PokemonTemp.encounterType == EncounterTypes::GoodRod ||
$PokemonTemp.encounterType == EncounterTypes::SuperRod
terrainTag = pbFacingTerrainTag
else
terrainTag = $game_player.terrain_tag
end
case terrainTag
when PBTerrain::Grass, PBTerrain::SootGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::Grass
ret = (ret == PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::Grass
when PBTerrain::TallGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::TallGrass
when PBTerrain::Rock; ret = PBEnvironment::Rock
when PBTerrain::Sand; ret = PBEnvironment::Sand
when PBTerrain::DeepWater, PBTerrain::Water; ret = PBEnvironment::MovingWater
when PBTerrain::StillWater; ret = PBEnvironment::StillWater
when PBTerrain::Puddle; ret = PBEnvironment::Puddle
when PBTerrain::Ice; ret = PBEnvironment::Ice
ret = (ret == PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::TallGrass
when PBTerrain::Rock then ret = PBEnvironment::Rock
when PBTerrain::Sand then ret = PBEnvironment::Sand
when PBTerrain::DeepWater, PBTerrain::Water then ret = PBEnvironment::MovingWater
when PBTerrain::StillWater then ret = PBEnvironment::StillWater
when PBTerrain::Puddle then ret = PBEnvironment::Puddle
when PBTerrain::Ice then ret = PBEnvironment::Ice
end
return ret
end

View File

@@ -335,22 +335,31 @@ class Maze
end
end
def recurseDepthFirst(x,y,depth)
def recurseDepthFirst(x, y, depth)
setVisited(x,y)
dirs=@@dirs.shuffle!
dirs = @@dirs.shuffle!
for c in 0...4
d=dirs[c]
cx=0;cy=0
d = dirs[c]
cx = 0
cy = 0
case d
when EdgeMasks::North; cx=x; cy=y-1
when EdgeMasks::South; cx=x; cy=y+1
when EdgeMasks::East; cx=x+1; cy=y
when EdgeMasks::West; cx=x-1; cy=y
when EdgeMasks::North
cx = x
cy = y - 1
when EdgeMasks::South
cx = x
cy = y + 1
when EdgeMasks::East
cx = x + 1
cy = y
when EdgeMasks::West
cx = x - 1
cy = y
end
if cx>=0 && cy>=0 && cx<cellWidth && cy<cellHeight
if !getVisited(cx,cy)
clearEdgeNode(x,y,d)
recurseDepthFirst(cx,cy,depth+1)
if cx >= 0 && cy >= 0 && cx < cellWidth && cy < cellHeight
if !getVisited(cx, cy)
clearEdgeNode(x, y, d)
recurseDepthFirst(cx, cy, depth + 1)
end
end
end

View File

@@ -37,10 +37,10 @@ class BerryPlantMoistureSprite
def updateGraphic
case @oldmoisture
when -1; @light.setBitmap("")
when 0; @light.setBitmap("Graphics/Characters/berrytreeDry")
when 1; @light.setBitmap("Graphics/Characters/berrytreeDamp")
when 2; @light.setBitmap("Graphics/Characters/berrytreeWet")
when -1 then @light.setBitmap("")
when 0 then @light.setBitmap("Graphics/Characters/berrytreeDry")
when 1 then @light.setBitmap("Graphics/Characters/berrytreeDamp")
when 2 then @light.setBitmap("Graphics/Characters/berrytreeWet")
end
end
@@ -257,10 +257,10 @@ class BerryPlantSprite
if pbResolveBitmap("Graphics/Characters/"+filename)
@event.character_name=filename
case berryData[0]
when 2; @event.turn_down # X sprouted
when 3; @event.turn_left # X taller
when 4; @event.turn_right # X flowering
when 5; @event.turn_up # X berries
when 2 then @event.turn_down # X sprouted
when 3 then @event.turn_left # X taller
when 4 then @event.turn_right # X flowering
when 5 then @event.turn_up # X berries
end
else
@event.character_name="Object ball"
@@ -288,11 +288,11 @@ def pbBerryPlant
end
# Stop the event turning towards the player
case berryData[0]
when 1; thisEvent.turn_down # X planted
when 2; thisEvent.turn_down # X sprouted
when 3; thisEvent.turn_left # X taller
when 4; thisEvent.turn_right # X flowering
when 5; thisEvent.turn_up # X berries
when 1 then thisEvent.turn_down # X planted
when 2 then thisEvent.turn_down # X sprouted
when 3 then thisEvent.turn_left # X taller
when 4 then thisEvent.turn_right # X flowering
when 5 then thisEvent.turn_up # X berries
end
watering = [:SPRAYDUCK, :SQUIRTBOTTLE, :WAILMERPAIL, :SPRINKLOTAD]
berry=berryData[1]

View File

@@ -65,10 +65,10 @@ def moveThrough(follower,direction)
oldThrough=follower.through
follower.through=true
case direction
when 2; follower.move_down # down
when 4; follower.move_left # left
when 6; follower.move_right # right
when 8; follower.move_up # up
when 2 then follower.move_down
when 4 then follower.move_left
when 6 then follower.move_right
when 8 then follower.move_up
end
follower.through=oldThrough
end
@@ -87,10 +87,10 @@ def moveFancy(follower,direction)
oldThrough=follower.through
follower.through=true
case direction
when 2; follower.move_down # down
when 4; follower.move_left # left
when 6; follower.move_right # right
when 8; follower.move_up # up
when 2 then follower.move_down
when 4 then follower.move_left
when 6 then follower.move_right
when 8 then follower.move_up
end
follower.through=oldThrough
end
@@ -155,11 +155,11 @@ class DependentEvents
newEvent = Game_Event.new(eventData[0],rpgEvent,$MapFactory.getMap(eventData[2]))
newEvent.character_name = eventData[6]
newEvent.character_hue = eventData[7]
case eventData[5] # direction
when 2; newEvent.turn_down
when 4; newEvent.turn_left
when 6; newEvent.turn_right
when 8; newEvent.turn_up
case eventData[5] # direction
when 2 then newEvent.turn_down
when 4 then newEvent.turn_left
when 6 then newEvent.turn_right
when 8 then newEvent.turn_up
end
return newEvent
end