Applied most Rubocop-suggested layout fixes

This commit is contained in:
Maruno17
2021-12-18 01:56:10 +00:00
parent 5dc64f1709
commit 2480ab0f9e
88 changed files with 839 additions and 783 deletions

View File

@@ -347,10 +347,11 @@ module Compiler
GameData::Move.register(move_hash)
end
# Parse move
line = pbGetCsvRecord(line, line_no, [0, "snssueeuuueiss",
nil, nil, nil, nil, nil, :Type, ["Physical", "Special", "Status"],
nil, nil, nil, :Target, nil, nil, nil
])
line = pbGetCsvRecord(line, line_no,
[0, "snssueeuuueiss",
nil, nil, nil, nil, nil, :Type, ["Physical", "Special", "Status"],
nil, nil, nil, :Target, nil, nil, nil]
)
move_id = line[1].to_sym
if GameData::Move::DATA[move_id]
raise _INTL("Move ID '{1}' is used twice.\r\n{2}", move_id, FileLineData.linereport)
@@ -467,8 +468,10 @@ module Compiler
# Add previous item's data to records
GameData::Item.register(item_hash) if item_hash
# Parse item
line = pbGetCsvRecord(line, line_no, [0, "snssvusuuUE", nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, :Move])
line = pbGetCsvRecord(line, line_no,
[0, "snssvusuuUE", nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, :Move]
)
item_id = line[1].to_sym
if GameData::Item.exists?(item_id)
raise _INTL("Item ID '{1}' is used twice.\r\n{2}", item_id, FileLineData.linereport)
@@ -1337,12 +1340,14 @@ module Compiler
# Add previous trainer type's data to records
GameData::TrainerType.register(tr_type_hash) if tr_type_hash
# Parse trainer type
line = pbGetCsvRecord(line, line_no, [0, "snsUSSSeUS",
nil, nil, nil, nil, nil, nil, nil, {
"Male" => 0, "M" => 0, "0" => 0,
"Female" => 1, "F" => 1, "1" => 1,
"Mixed" => 2, "X" => 2, "2" => 2, "" => 2
}, nil, nil])
line = pbGetCsvRecord(line, line_no,
[0, "snsUSSSeUS",
nil, nil, nil, nil, nil, nil, nil,
{ "Male" => 0, "M" => 0, "0" => 0,
"Female" => 1, "F" => 1, "1" => 1,
"Mixed" => 2, "X" => 2, "2" => 2, "" => 2 },
nil, nil]
)
tr_type_id = line[1].to_sym
if GameData::TrainerType.exists?(tr_type_id)
raise _INTL("Trainer Type ID '{1}' is used twice.\r\n{2}", tr_type_id, FileLineData.linereport)

View File

@@ -786,16 +786,18 @@ module Compiler
PBMoveRoute::PlaySE,RPG::AudioFile.new("Door enter"),PBMoveRoute::Wait,2,
PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2,
PBMoveRoute::TurnRight,PBMoveRoute::Wait,2,
PBMoveRoute::TurnUp,PBMoveRoute::Wait,2])
PBMoveRoute::TurnUp,PBMoveRoute::Wait,2
])
push_move_route_and_wait(list,-1,[ # Move Route for player entering door
PBMoveRoute::ThroughOn,PBMoveRoute::Up,PBMoveRoute::ThroughOff])
PBMoveRoute::ThroughOn,PBMoveRoute::Up,PBMoveRoute::ThroughOff
])
push_event(list,208,[0]) # Change Transparent Flag (invisible)
push_script(list, "Followers.follow_into_door")
push_event(list, 210, [], indent) # Wait for Move's Completion
push_move_route_and_wait(list,0,[PBMoveRoute::Wait,2, # Move Route for door closing
PBMoveRoute::TurnRight,PBMoveRoute::Wait,2,
PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2,
PBMoveRoute::TurnDown,PBMoveRoute::Wait,2])
PBMoveRoute::TurnRight,PBMoveRoute::Wait,2,
PBMoveRoute::TurnLeft,PBMoveRoute::Wait,2,
PBMoveRoute::TurnDown,PBMoveRoute::Wait,2])
push_event(list,223,[Tone.new(-255,-255,-255),6]) # Change Screen Color Tone
push_wait(list,8) # Wait
push_event(list,208,[1]) # Change Transparent Flag (visible)
@@ -809,14 +811,16 @@ module Compiler
push_event(list,208,[0],1) # Change Transparent Flag (invisible)
push_script(list, "Followers.hide_followers", 1)
push_move_route_and_wait(list,0,[ # Move Route for setting door to open
PBMoveRoute::TurnLeft,PBMoveRoute::Wait,6],1)
PBMoveRoute::TurnLeft,PBMoveRoute::Wait,6
],1)
push_event(list,208,[1],1) # Change Transparent Flag (visible)
push_move_route_and_wait(list,-1,[PBMoveRoute::Down],1) # Move Route for player exiting door
push_script(list, "Followers.put_followers_on_player", 1)
push_move_route_and_wait(list,0,[ # Move Route for door closing
PBMoveRoute::TurnUp,PBMoveRoute::Wait,2,
PBMoveRoute::TurnRight,PBMoveRoute::Wait,2,
PBMoveRoute::TurnDown,PBMoveRoute::Wait,2],1)
PBMoveRoute::TurnDown,PBMoveRoute::Wait,2
],1)
push_branch_end(list,1)
push_script(list,"setTempSwitchOn(\"A\")")
push_end(list)
@@ -973,7 +977,6 @@ module Compiler
push_script(newEvents,"pbReceiveItem(:#{itemname})",oldIndent+1)
push_else(newEvents,oldIndent+1)
push_text(newEvents,_INTL("You have no room left in the Bag."),oldIndent+1)
push_branch_end(newEvents,oldIndent+1)
else
push_event(newEvents,111,[7,cost,0],oldIndent)
push_branch(newEvents,"$bag.can_add?(:#{itemname})",oldIndent+1)
@@ -985,8 +988,8 @@ module Compiler
push_branch_end(newEvents,oldIndent+2)
push_else(newEvents,oldIndent+1)
push_text(newEvents,_INTL("\\GYou don't have enough money."),oldIndent+1)
push_branch_end(newEvents,oldIndent+1)
end
push_branch_end(newEvents,oldIndent+1)
list[i,0] = newEvents # insert 'newEvents' at index 'i'
changed = true
end
@@ -1238,7 +1241,7 @@ module Compiler
end
# Find a punctuation mark to split at
punct = [message.rindex(". "),message.rindex(".\n"),
message.rindex("!"),message.rindex("?"),-1].compact.max
message.rindex("!"),message.rindex("?"),-1].compact.max
if punct==-1
punct = [message.rindex(", "),message.rindex(",\n"),-1].compact.max
end