rmxp_extractor 1.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +13 -13
- data/Gemfile.lock +40 -40
- data/LICENSE.txt +21 -21
- data/README.md +37 -35
- data/Rakefile +6 -6
- data/bin/rmxp_extractor +13 -13
- data/bin/setup +8 -8
- data/diff_check.rb +13 -13
- data/lib/rmxp_extractor/classnames.rb +227 -245
- data/lib/rmxp_extractor/data_export.rb +80 -82
- data/lib/rmxp_extractor/data_import.rb +74 -69
- data/lib/rmxp_extractor/ron.rb +144 -144
- data/lib/rmxp_extractor/script_handler.rb +85 -85
- data/lib/rmxp_extractor/version.rb +3 -3
- data/lib/rmxp_extractor.rb +46 -46
- data/rmxp_extractor.gemspec +30 -30
- data/spec/spec_helper.rb +100 -100
- metadata +2 -393
- data/Data/Actors.rxdata +0 -0
- data/Data/Animations.rxdata +0 -0
- data/Data/Armors.rxdata +0 -0
- data/Data/Classes.rxdata +0 -0
- data/Data/CommonEvents.rxdata +0 -0
- data/Data/Enemies.rxdata +0 -0
- data/Data/Items.rxdata +0 -0
- data/Data/Map001.rxdata +0 -0
- data/Data/Map002.rxdata +0 -0
- data/Data/Map003.rxdata +0 -0
- data/Data/Map004.rxdata +0 -0
- data/Data/Map005.rxdata +0 -0
- data/Data/Map006.rxdata +0 -0
- data/Data/Map007.rxdata +0 -0
- data/Data/Map008.rxdata +0 -0
- data/Data/Map009.rxdata +0 -0
- data/Data/Map010.rxdata +0 -0
- data/Data/Map011.rxdata +0 -0
- data/Data/Map012.rxdata +0 -0
- data/Data/Map013.rxdata +0 -0
- data/Data/Map014.rxdata +0 -0
- data/Data/Map015.rxdata +0 -0
- data/Data/Map016.rxdata +0 -0
- data/Data/Map017.rxdata +0 -0
- data/Data/Map018.rxdata +0 -0
- data/Data/Map019.rxdata +0 -0
- data/Data/Map020.rxdata +0 -0
- data/Data/Map021.rxdata +0 -0
- data/Data/Map022.rxdata +0 -0
- data/Data/Map023.rxdata +0 -0
- data/Data/Map024.rxdata +0 -0
- data/Data/Map025.rxdata +0 -0
- data/Data/Map026.rxdata +0 -0
- data/Data/Map027.rxdata +0 -0
- data/Data/Map028.rxdata +0 -0
- data/Data/Map029.rxdata +0 -0
- data/Data/Map030.rxdata +0 -0
- data/Data/Map031.rxdata +0 -0
- data/Data/Map032.rxdata +0 -0
- data/Data/Map033.rxdata +0 -0
- data/Data/Map034.rxdata +0 -0
- data/Data/Map035.rxdata +0 -0
- data/Data/Map036.rxdata +0 -0
- data/Data/Map037.rxdata +0 -0
- data/Data/Map038.rxdata +0 -0
- data/Data/Map039.rxdata +0 -0
- data/Data/Map040.rxdata +0 -0
- data/Data/Map041.rxdata +0 -0
- data/Data/Map042.rxdata +0 -0
- data/Data/Map043.rxdata +0 -0
- data/Data/Map044.rxdata +0 -0
- data/Data/Map045.rxdata +0 -0
- data/Data/Map046.rxdata +0 -0
- data/Data/Map047.rxdata +0 -0
- data/Data/Map048.rxdata +0 -0
- data/Data/Map049.rxdata +0 -0
- data/Data/Map050.rxdata +0 -0
- data/Data/Map051.rxdata +0 -0
- data/Data/Map052.rxdata +0 -0
- data/Data/Map053.rxdata +0 -0
- data/Data/Map054.rxdata +0 -0
- data/Data/Map055.rxdata +0 -0
- data/Data/Map056.rxdata +0 -0
- data/Data/Map057.rxdata +0 -0
- data/Data/Map058.rxdata +0 -0
- data/Data/Map059.rxdata +0 -0
- data/Data/Map060.rxdata +0 -0
- data/Data/Map061.rxdata +0 -0
- data/Data/Map062.rxdata +0 -0
- data/Data/Map063.rxdata +0 -0
- data/Data/Map064.rxdata +0 -0
- data/Data/Map065.rxdata +0 -0
- data/Data/Map066.rxdata +0 -0
- data/Data/Map067.rxdata +0 -0
- data/Data/Map068.rxdata +0 -0
- data/Data/Map069.rxdata +0 -0
- data/Data/Map070.rxdata +0 -0
- data/Data/Map071.rxdata +0 -0
- data/Data/Map072.rxdata +0 -0
- data/Data/Map073.rxdata +0 -0
- data/Data/Map074.rxdata +0 -0
- data/Data/Map075.rxdata +0 -0
- data/Data/Map076.rxdata +0 -0
- data/Data/Map077.rxdata +0 -0
- data/Data/Map078.rxdata +0 -0
- data/Data/Map079.rxdata +0 -0
- data/Data/Map080.rxdata +0 -0
- data/Data/Map081.rxdata +0 -0
- data/Data/Map082.rxdata +0 -0
- data/Data/Map083.rxdata +0 -0
- data/Data/Map084.rxdata +0 -0
- data/Data/Map085.rxdata +0 -0
- data/Data/Map086.rxdata +0 -0
- data/Data/Map087.rxdata +0 -0
- data/Data/Map088.rxdata +0 -0
- data/Data/Map089.rxdata +0 -0
- data/Data/Map090.rxdata +0 -0
- data/Data/Map091.rxdata +0 -0
- data/Data/Map092.rxdata +0 -0
- data/Data/Map093.rxdata +0 -0
- data/Data/Map094.rxdata +0 -0
- data/Data/Map095.rxdata +0 -0
- data/Data/Map096.rxdata +0 -0
- data/Data/Map097.rxdata +0 -0
- data/Data/Map098.rxdata +0 -0
- data/Data/Map099.rxdata +0 -0
- data/Data/Map100.rxdata +0 -0
- data/Data/Map101.rxdata +0 -0
- data/Data/Map102.rxdata +0 -0
- data/Data/Map103.rxdata +0 -0
- data/Data/Map104.rxdata +0 -0
- data/Data/Map105.rxdata +0 -0
- data/Data/Map106.rxdata +0 -0
- data/Data/Map107.rxdata +0 -0
- data/Data/Map108.rxdata +0 -0
- data/Data/Map109.rxdata +0 -0
- data/Data/Map110.rxdata +0 -0
- data/Data/Map111.rxdata +0 -0
- data/Data/Map112.rxdata +0 -0
- data/Data/Map113.rxdata +0 -0
- data/Data/Map114.rxdata +0 -0
- data/Data/Map115.rxdata +0 -0
- data/Data/Map116.rxdata +0 -0
- data/Data/Map117.rxdata +0 -0
- data/Data/Map118.rxdata +0 -0
- data/Data/Map119.rxdata +0 -0
- data/Data/Map120.rxdata +0 -0
- data/Data/Map121.rxdata +0 -0
- data/Data/Map122.rxdata +0 -0
- data/Data/Map123.rxdata +0 -0
- data/Data/Map124.rxdata +0 -0
- data/Data/Map125.rxdata +0 -0
- data/Data/Map126.rxdata +0 -0
- data/Data/Map127.rxdata +0 -0
- data/Data/Map128.rxdata +0 -0
- data/Data/Map129.rxdata +0 -0
- data/Data/Map130.rxdata +0 -0
- data/Data/Map131.rxdata +0 -0
- data/Data/Map132.rxdata +0 -0
- data/Data/Map133.rxdata +0 -0
- data/Data/Map134.rxdata +0 -0
- data/Data/Map135.rxdata +0 -0
- data/Data/Map136.rxdata +0 -0
- data/Data/Map137.rxdata +0 -0
- data/Data/Map138.rxdata +0 -0
- data/Data/Map139.rxdata +0 -0
- data/Data/Map140.rxdata +0 -0
- data/Data/Map141.rxdata +0 -0
- data/Data/Map142.rxdata +0 -0
- data/Data/Map143.rxdata +0 -0
- data/Data/Map144.rxdata +0 -0
- data/Data/Map145.rxdata +0 -0
- data/Data/Map146.rxdata +0 -0
- data/Data/Map147.rxdata +0 -0
- data/Data/Map148.rxdata +0 -0
- data/Data/Map149.rxdata +0 -0
- data/Data/Map150.rxdata +0 -0
- data/Data/Map151.rxdata +0 -0
- data/Data/Map152.rxdata +0 -0
- data/Data/Map153.rxdata +0 -0
- data/Data/Map154.rxdata +0 -0
- data/Data/Map155.rxdata +0 -0
- data/Data/Map156.rxdata +0 -0
- data/Data/Map157.rxdata +0 -0
- data/Data/Map158.rxdata +0 -0
- data/Data/Map159.rxdata +0 -0
- data/Data/Map160.rxdata +0 -0
- data/Data/Map161.rxdata +0 -0
- data/Data/Map162.rxdata +0 -0
- data/Data/Map163.rxdata +0 -0
- data/Data/Map164.rxdata +0 -0
- data/Data/Map165.rxdata +0 -0
- data/Data/Map166.rxdata +0 -0
- data/Data/Map167.rxdata +0 -0
- data/Data/Map168.rxdata +0 -0
- data/Data/Map169.rxdata +0 -0
- data/Data/Map170.rxdata +0 -0
- data/Data/Map171.rxdata +0 -0
- data/Data/Map172.rxdata +0 -0
- data/Data/Map173.rxdata +0 -0
- data/Data/Map174.rxdata +0 -0
- data/Data/Map175.rxdata +0 -0
- data/Data/Map176.rxdata +0 -0
- data/Data/Map177.rxdata +0 -0
- data/Data/Map178.rxdata +0 -0
- data/Data/Map179.rxdata +0 -0
- data/Data/Map180.rxdata +0 -0
- data/Data/Map181.rxdata +0 -0
- data/Data/Map182.rxdata +0 -0
- data/Data/Map183.rxdata +0 -0
- data/Data/Map184.rxdata +0 -0
- data/Data/Map185.rxdata +0 -0
- data/Data/Map186.rxdata +0 -0
- data/Data/Map187.rxdata +0 -0
- data/Data/Map188.rxdata +0 -0
- data/Data/Map189.rxdata +0 -0
- data/Data/Map190.rxdata +0 -0
- data/Data/Map191.rxdata +0 -0
- data/Data/Map192.rxdata +0 -0
- data/Data/Map193.rxdata +0 -0
- data/Data/Map194.rxdata +0 -0
- data/Data/Map195.rxdata +0 -0
- data/Data/Map196.rxdata +0 -0
- data/Data/Map197.rxdata +0 -0
- data/Data/Map198.rxdata +0 -0
- data/Data/Map199.rxdata +0 -0
- data/Data/Map200.rxdata +0 -0
- data/Data/Map201.rxdata +0 -0
- data/Data/Map202.rxdata +0 -0
- data/Data/Map203.rxdata +0 -0
- data/Data/Map204.rxdata +0 -0
- data/Data/Map205.rxdata +0 -0
- data/Data/Map206.rxdata +0 -0
- data/Data/Map207.rxdata +0 -0
- data/Data/Map208.rxdata +0 -0
- data/Data/Map209.rxdata +0 -0
- data/Data/Map210.rxdata +0 -0
- data/Data/Map211.rxdata +0 -0
- data/Data/Map212.rxdata +0 -0
- data/Data/Map213.rxdata +0 -0
- data/Data/Map214.rxdata +0 -0
- data/Data/Map215.rxdata +0 -0
- data/Data/Map216.rxdata +0 -0
- data/Data/Map217.rxdata +0 -0
- data/Data/Map218.rxdata +0 -0
- data/Data/Map219.rxdata +0 -0
- data/Data/Map220.rxdata +0 -0
- data/Data/Map221.rxdata +0 -0
- data/Data/Map222.rxdata +0 -0
- data/Data/Map223.rxdata +0 -0
- data/Data/Map224.rxdata +0 -0
- data/Data/Map225.rxdata +0 -0
- data/Data/Map226.rxdata +0 -0
- data/Data/Map227.rxdata +0 -0
- data/Data/Map228.rxdata +0 -0
- data/Data/Map229.rxdata +0 -0
- data/Data/Map230.rxdata +0 -0
- data/Data/Map231.rxdata +0 -0
- data/Data/Map232.rxdata +0 -0
- data/Data/Map233.rxdata +0 -0
- data/Data/Map234.rxdata +0 -0
- data/Data/Map235.rxdata +0 -0
- data/Data/Map236.rxdata +0 -0
- data/Data/Map237.rxdata +0 -0
- data/Data/Map238.rxdata +0 -0
- data/Data/Map239.rxdata +0 -0
- data/Data/Map240.rxdata +0 -0
- data/Data/Map241.rxdata +0 -0
- data/Data/Map242.rxdata +0 -0
- data/Data/Map243.rxdata +0 -0
- data/Data/Map244.rxdata +0 -0
- data/Data/Map245.rxdata +0 -0
- data/Data/Map246.rxdata +0 -0
- data/Data/Map247.rxdata +0 -0
- data/Data/Map248.rxdata +0 -0
- data/Data/Map249.rxdata +0 -0
- data/Data/Map250.rxdata +0 -0
- data/Data/Map251.rxdata +0 -0
- data/Data/Map252.rxdata +0 -0
- data/Data/Map253.rxdata +0 -0
- data/Data/Map254.rxdata +0 -0
- data/Data/Map255.rxdata +0 -0
- data/Data/Map256.rxdata +0 -0
- data/Data/Map257.rxdata +0 -0
- data/Data/Map258.rxdata +0 -0
- data/Data/Map259.rxdata +0 -0
- data/Data/Map260.rxdata +0 -0
- data/Data/Map261.rxdata +0 -0
- data/Data/Map262.rxdata +0 -0
- data/Data/Map263.rxdata +0 -0
- data/Data/MapInfos.rxdata +0 -0
- data/Data/Scripts.rxdata +0 -0
- data/Data/Skills.rxdata +0 -0
- data/Data/States.rxdata +0 -0
- data/Data/System.rxdata +0 -0
- data/Data/Tilesets.rxdata +0 -0
- data/Data/Troops.rxdata +0 -0
- data/Data/Weapons.rxdata +0 -0
- data/Data/xScripts.rxdata +0 -0
- data/Scripts/Credits_Message.rb +0 -259
- data/Scripts/Data_FastTravel.rb +0 -50
- data/Scripts/Data_Footsteps.rb +0 -77
- data/Scripts/Data_Item.rb +0 -50
- data/Scripts/Data_SpecialEventData.rb +0 -60
- data/Scripts/Demo.rb +0 -7
- data/Scripts/Desktop_Message.rb +0 -210
- data/Scripts/Doc_Message.rb +0 -273
- data/Scripts/EdText.rb +0 -50
- data/Scripts/Ed_Message.rb +0 -234
- data/Scripts/FastTravel.rb +0 -175
- data/Scripts/Game_Actor.rb +0 -156
- data/Scripts/Game_Actors.rb +0 -28
- data/Scripts/Game_BattleAction.rb +0 -145
- data/Scripts/Game_Battler 1.rb +0 -307
- data/Scripts/Game_Battler 2.rb +0 -294
- data/Scripts/Game_Battler 3.rb +0 -354
- data/Scripts/Game_Character 1.rb +0 -291
- data/Scripts/Game_Character 2.rb +0 -355
- data/Scripts/Game_Character 3.rb +0 -505
- data/Scripts/Game_CommonEvent.rb +0 -70
- data/Scripts/Game_Enemy.rb +0 -317
- data/Scripts/Game_Event.rb +0 -264
- data/Scripts/Game_FastTravel.rb +0 -40
- data/Scripts/Game_Follower.rb +0 -76
- data/Scripts/Game_Light.rb +0 -13
- data/Scripts/Game_Map.rb +0 -551
- data/Scripts/Game_Oneshot.rb +0 -83
- data/Scripts/Game_Party.rb +0 -380
- data/Scripts/Game_Picture.rb +0 -164
- data/Scripts/Game_Player.rb +0 -298
- data/Scripts/Game_Screen.rb +0 -148
- data/Scripts/Game_SelfSwitches.rb +0 -30
- data/Scripts/Game_Switches.rb +0 -45
- data/Scripts/Game_System.rb +0 -210
- data/Scripts/Game_Temp.rb +0 -145
- data/Scripts/Game_Variables.rb +0 -36
- data/Scripts/Interpreter 1.rb +0 -320
- data/Scripts/Interpreter 2.rb +0 -286
- data/Scripts/Interpreter 3.rb +0 -474
- data/Scripts/Interpreter 4.rb +0 -327
- data/Scripts/Interpreter 5.rb +0 -448
- data/Scripts/Interpreter 6.rb +0 -307
- data/Scripts/Interpreter 7.rb +0 -282
- data/Scripts/Main.rb +0 -50
- data/Scripts/Particles.rb +0 -141
- data/Scripts/Persistent.rb +0 -71
- data/Scripts/Puzzle_Film.rb +0 -14
- data/Scripts/Puzzle_Pixel.rb +0 -210
- data/Scripts/Puzzle_Safe.rb +0 -152
- data/Scripts/Puzzle_Sokoban.rb +0 -14
- data/Scripts/RPG.rb +0 -55
- data/Scripts/SaveLoad.rb +0 -275
- data/Scripts/Scene_Debug.rb +0 -190
- data/Scripts/Scene_End.rb +0 -108
- data/Scripts/Scene_Equip.rb +0 -222
- data/Scripts/Scene_File.rb +0 -111
- data/Scripts/Scene_Item.rb +0 -205
- data/Scripts/Scene_Load.rb +0 -106
- data/Scripts/Scene_Map.rb +0 -540
- data/Scripts/Scene_Menu.rb +0 -213
- data/Scripts/Scene_Name.rb +0 -113
- data/Scripts/Scene_Save.rb +0 -88
- data/Scripts/Scene_Skill.rb +0 -232
- data/Scripts/Scene_Status.rb +0 -78
- data/Scripts/Scene_Title.rb +0 -237
- data/Scripts/Script.rb +0 -780
- data/Scripts/Sprite_Battler.rb +0 -131
- data/Scripts/Sprite_Character.rb +0 -192
- data/Scripts/Sprite_Footprint.rb +0 -35
- data/Scripts/Sprite_Footsplash.rb +0 -54
- data/Scripts/Sprite_Light.rb +0 -18
- data/Scripts/Sprite_MapText.rb +0 -63
- data/Scripts/Sprite_Picture.rb +0 -72
- data/Scripts/Sprite_Timer.rb +0 -52
- data/Scripts/Spriteset_Map.rb +0 -370
- data/Scripts/Window_Base.rb +0 -327
- data/Scripts/Window_BattleResult.rb +0 -51
- data/Scripts/Window_BattleStatus.rb +0 -62
- data/Scripts/Window_Command.rb +0 -49
- data/Scripts/Window_DebugLeft.rb +0 -57
- data/Scripts/Window_DebugRight.rb +0 -69
- data/Scripts/Window_EquipItem.rb +0 -94
- data/Scripts/Window_EquipLeft.rb +0 -61
- data/Scripts/Window_EquipRight.rb +0 -56
- data/Scripts/Window_Gold.rb +0 -27
- data/Scripts/Window_Help.rb +0 -33
- data/Scripts/Window_InputNumber.rb +0 -111
- data/Scripts/Window_Item.rb +0 -229
- data/Scripts/Window_MainMenu.rb +0 -150
- data/Scripts/Window_MenuStatus.rb +0 -48
- data/Scripts/Window_Message.rb +0 -459
- data/Scripts/Window_NameEdit.rb +0 -108
- data/Scripts/Window_NameInput.rb +0 -262
- data/Scripts/Window_PartyCommand.rb +0 -42
- data/Scripts/Window_PlayTime.rb +0 -40
- data/Scripts/Window_SaveFile.rb +0 -91
- data/Scripts/Window_Selectable.rb +0 -203
- data/Scripts/Window_Settings.rb +0 -469
- data/Scripts/Window_ShopBuy.rb +0 -93
- data/Scripts/Window_ShopCommand.rb +0 -37
- data/Scripts/Window_ShopNumber.rb +0 -87
- data/Scripts/Window_ShopSell.rb +0 -94
- data/Scripts/Window_ShopStatus.rb +0 -107
- data/Scripts/Window_Skill.rb +0 -83
- data/Scripts/Window_SkillStatus.rb +0 -28
- data/Scripts/Window_Status.rb +0 -64
- data/Scripts/Window_Steps.rb +0 -26
- data/Scripts/Window_Target.rb +0 -49
- data/Scripts/_scripts.txt +0 -111
- data/Scripts/i18n_English.rb +0 -59
- data/Scripts/i18n_Language.rb +0 -130
data/Scripts/Script.rb
DELETED
@@ -1,780 +0,0 @@
|
|
1
|
-
PROTO_TEXT = "put me in the big portal"
|
2
|
-
CEDRIC_TEXT = "put me in the big portal"
|
3
|
-
RUE_TEXT = "put me in the big portal"
|
4
|
-
|
5
|
-
SUPPORTED_DE = ["cinnamon", "gnome", "mate", "kde", "xfce"]
|
6
|
-
|
7
|
-
module Script
|
8
|
-
def self.px
|
9
|
-
logpos($game_player.x, $game_player.real_x, $game_player.direction == 6)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.py
|
13
|
-
logpos($game_player.y, $game_player.real_y, $game_player.direction == 2)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.is_name_swear
|
17
|
-
test_string = $game_oneshot.player_name.downcase
|
18
|
-
if ["fuck", "shit", "ass", "cock", "damn", "penis", "tiddy", "titty", "cunt", "fag", "whore"].any? { |swear| test_string.include? swear }
|
19
|
-
return true
|
20
|
-
end
|
21
|
-
return false
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.is_name_niko
|
25
|
-
test_string = $game_oneshot.player_name.downcase
|
26
|
-
if test_string == "niko"
|
27
|
-
return true
|
28
|
-
end
|
29
|
-
return false
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.is_name_like_niko
|
33
|
-
test_string = $game_oneshot.player_name.downcase
|
34
|
-
if ["nico", "nikko", "nicco", "nikoh", "nicoh"].any? { |name| test_string == name }
|
35
|
-
return true
|
36
|
-
end
|
37
|
-
return false
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.is_name_like_mom_dad
|
41
|
-
test_string = $game_oneshot.player_name.downcase
|
42
|
-
if ["mom", "dad", "mommy", "daddy", "mama", "papa"].any? { |name| test_string == name }
|
43
|
-
return true
|
44
|
-
end
|
45
|
-
return false
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.is_name_gross
|
49
|
-
test_string = $game_oneshot.player_name.downcase
|
50
|
-
if ["poo", "pee", "fart", "stinky", "piss", "shit", "slimy"].any? { |name| test_string == name }
|
51
|
-
return true
|
52
|
-
end
|
53
|
-
return false
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.start_bruteforce
|
57
|
-
$game_oneshot.bruteforce_start = Graphics.frame_count
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.check_bruteforce
|
61
|
-
if($game_oneshot.bruteforce_start == nil)
|
62
|
-
$game_oneshot.bruteforce_start = Graphics.frame_count
|
63
|
-
end
|
64
|
-
time_passed = Graphics.frame_count - $game_oneshot.bruteforce_start
|
65
|
-
if(time_passed > (2 * 60 * 63014))
|
66
|
-
return true
|
67
|
-
else
|
68
|
-
return false
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.skip_bruteforce
|
73
|
-
$game_oneshot.bruteforce_start -= 62800*2*60
|
74
|
-
end
|
75
|
-
|
76
|
-
def self.lose_all_items
|
77
|
-
for i in 1..99
|
78
|
-
$game_party.lose_item(i, 99)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def self.bruteforce_vars
|
83
|
-
if($game_oneshot.bruteforce_start == nil)
|
84
|
-
$game_oneshot.bruteforce_start = Graphics.frame_count
|
85
|
-
end
|
86
|
-
time_passed = Graphics.frame_count - $game_oneshot.bruteforce_start
|
87
|
-
counts_tried = time_passed / (2 * 60)
|
88
|
-
digit1 = counts_tried % 10;
|
89
|
-
digit2 = ((counts_tried % 100) - digit1) / 10
|
90
|
-
digit3 = ((counts_tried % 1000) - (digit2 * 10) - digit1) / 100
|
91
|
-
digit4 = ((counts_tried % 10000) - (digit3 * 100) - (digit2 * 10) - digit1) / 1000
|
92
|
-
digit5 = ((counts_tried % 100000) - (digit4 * 1000) - (digit3 * 100) - (digit2 * 10) - digit1) / 10000
|
93
|
-
$game_variables[26] = digit5
|
94
|
-
$game_variables[27] = digit4
|
95
|
-
$game_variables[28] = digit3
|
96
|
-
$game_variables[29] = digit2
|
97
|
-
$game_variables[30] = digit1
|
98
|
-
end
|
99
|
-
|
100
|
-
def self.fix_footsplashes(xDelta, yDelta)
|
101
|
-
$scene.fix_footsplashes(xDelta, yDelta)
|
102
|
-
end
|
103
|
-
|
104
|
-
def self.move_player_relative(x, y)
|
105
|
-
$game_player.x += x
|
106
|
-
$game_player.y += y
|
107
|
-
$game_player.real_x += x * 4 * 32
|
108
|
-
$game_player.real_y += y * 4 * 32
|
109
|
-
$game_map.display_x += x * 4 * 32
|
110
|
-
$game_map.display_y += y * 4 * 32
|
111
|
-
end
|
112
|
-
|
113
|
-
def self.move_player(x, y)
|
114
|
-
xDelta = x - $game_player.x
|
115
|
-
yDelta = y - $game_player.y
|
116
|
-
Script.move_player_relative(xDelta, yDelta)
|
117
|
-
end
|
118
|
-
|
119
|
-
def self.eve_x(name)
|
120
|
-
for event in $game_map.events.values
|
121
|
-
if event.name == name
|
122
|
-
return logpos(event.x, event.real_x, event.direction == 6)
|
123
|
-
end
|
124
|
-
end
|
125
|
-
return 0
|
126
|
-
end
|
127
|
-
|
128
|
-
def self.eve_y(name)
|
129
|
-
for event in $game_map.events.values
|
130
|
-
if event.name == name
|
131
|
-
return logpos(event.y, event.real_y, event.direction == 2)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
return 0
|
135
|
-
end
|
136
|
-
|
137
|
-
def self.countdown_over
|
138
|
-
equinox = Time.new(2017, 03, 27)
|
139
|
-
diff = equinox - Time.now
|
140
|
-
if(diff <= 0)
|
141
|
-
return true
|
142
|
-
end
|
143
|
-
return false
|
144
|
-
end
|
145
|
-
|
146
|
-
def self.countdown_extend_over
|
147
|
-
equinox = Time.new(2017, 03, 27)
|
148
|
-
diff = equinox - Time.now
|
149
|
-
if(diff <= 0)
|
150
|
-
return true
|
151
|
-
end
|
152
|
-
return false
|
153
|
-
end
|
154
|
-
|
155
|
-
def self.cdown_update(equinox)
|
156
|
-
diff = equinox - Time.now
|
157
|
-
if(diff < 0)
|
158
|
-
diff = 0
|
159
|
-
end
|
160
|
-
seconds = diff % 60
|
161
|
-
minutes = ((diff - seconds)/ 60) % 60
|
162
|
-
hours = ((((diff - seconds)/ 60) - minutes) / 60) % 24
|
163
|
-
days = (((((diff - seconds)/ 60) - minutes) / 60) - hours) / 24
|
164
|
-
secs1 = seconds % 10
|
165
|
-
secs2 = (seconds - secs1) / 10
|
166
|
-
mins1 = minutes % 10
|
167
|
-
mins2 = (minutes - mins1) / 10
|
168
|
-
hrs1 = hours % 10
|
169
|
-
hrs2 = (hours - hrs1) / 10
|
170
|
-
dys1 = days % 10
|
171
|
-
dys2 = ((days - dys1) / 10) % 10
|
172
|
-
dys3 = ((days - dys1 - (dys2*10)) / 100) % 10
|
173
|
-
dys4 = ((days - dys1 - (dys2*10) - (dys3*100)) / 1000) % 10
|
174
|
-
secs1 = secs1.floor
|
175
|
-
change = false
|
176
|
-
if secs1 != $game_variables[101]
|
177
|
-
$game_variables[101] = secs1
|
178
|
-
change = true
|
179
|
-
end
|
180
|
-
if secs2 != $game_variables[102]
|
181
|
-
$game_variables[102] = secs2
|
182
|
-
change = true
|
183
|
-
end
|
184
|
-
if mins1 != $game_variables[103]
|
185
|
-
$game_variables[103] = mins1
|
186
|
-
change = true
|
187
|
-
end
|
188
|
-
if mins2 != $game_variables[104]
|
189
|
-
$game_variables[104] = mins2
|
190
|
-
change = true
|
191
|
-
end
|
192
|
-
if hrs1 != $game_variables[105]
|
193
|
-
$game_variables[105] = hrs1
|
194
|
-
change = true
|
195
|
-
end
|
196
|
-
if hrs2 != $game_variables[106]
|
197
|
-
$game_variables[106] = hrs2
|
198
|
-
change = true
|
199
|
-
end
|
200
|
-
if dys1 != $game_variables[107]
|
201
|
-
$game_variables[107] = dys1
|
202
|
-
change = true
|
203
|
-
end
|
204
|
-
if dys2 != $game_variables[108]
|
205
|
-
$game_variables[108] = dys2
|
206
|
-
change = true
|
207
|
-
end
|
208
|
-
if dys3 != $game_variables[109]
|
209
|
-
$game_variables[109] = dys3
|
210
|
-
change = true
|
211
|
-
end
|
212
|
-
if dys4 != $game_variables[110]
|
213
|
-
$game_variables[110] = dys4
|
214
|
-
change = true
|
215
|
-
end
|
216
|
-
return change
|
217
|
-
end
|
218
|
-
|
219
|
-
def self.countdown_update
|
220
|
-
return cdown_update(Time.new(2017, 03, 27))
|
221
|
-
end
|
222
|
-
|
223
|
-
def self.countdown_extend_update
|
224
|
-
return cdown_update(Time.new(2017, 03, 27))
|
225
|
-
end
|
226
|
-
|
227
|
-
def self.countdown_update_rue
|
228
|
-
if @rue_equinox == nil
|
229
|
-
@rue_equinox = Time.now + 6
|
230
|
-
end
|
231
|
-
return cdown_update(@rue_equinox)
|
232
|
-
end
|
233
|
-
|
234
|
-
def self.niko_reflection_update
|
235
|
-
for event in $game_map.events.values
|
236
|
-
if event.name == "niko reflection"
|
237
|
-
event.real_y = 27*128/2 - ($game_player.real_y - 27*128/2)
|
238
|
-
event.real_x = $game_player.real_x
|
239
|
-
event.y = 14 - (($game_player.y - 13))
|
240
|
-
event.x = $game_player.x
|
241
|
-
if event.y > 14
|
242
|
-
event.y = 14
|
243
|
-
end
|
244
|
-
if event.real_y > 14*128
|
245
|
-
event.real_y = 14*128
|
246
|
-
end
|
247
|
-
event.direction = $game_player.direction
|
248
|
-
event.pattern = $game_player.pattern
|
249
|
-
case event.direction
|
250
|
-
when 2
|
251
|
-
event.direction = 8
|
252
|
-
when 8
|
253
|
-
event.direction = 2
|
254
|
-
end
|
255
|
-
return
|
256
|
-
end
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
def self.niko_reflection_enc_update
|
261
|
-
for event in $game_map.events.values
|
262
|
-
if event.name == "niko reflection"
|
263
|
-
event.real_y = 20*128 - ($game_player.real_y - 20*128)
|
264
|
-
event.real_x = $game_player.real_x
|
265
|
-
event.y = 20 - (($game_player.y - 20))
|
266
|
-
event.x = $game_player.x
|
267
|
-
if event.y > 19
|
268
|
-
event.y = 19
|
269
|
-
end
|
270
|
-
if event.real_y > 19*128
|
271
|
-
event.real_y = 19*128
|
272
|
-
end
|
273
|
-
|
274
|
-
if event.x > 14
|
275
|
-
event.x = 14
|
276
|
-
elsif event.x < 6
|
277
|
-
event.x = 6
|
278
|
-
end
|
279
|
-
if event.real_x > (14*128) - 32
|
280
|
-
event.real_x = (14*128) - 32
|
281
|
-
elsif event.real_x < (6*128) + 32
|
282
|
-
event.real_x = (6*128) + 32
|
283
|
-
end
|
284
|
-
|
285
|
-
event.direction = $game_player.direction
|
286
|
-
event.pattern = $game_player.pattern
|
287
|
-
case event.direction
|
288
|
-
when 2
|
289
|
-
event.direction = 8
|
290
|
-
when 8
|
291
|
-
event.direction = 2
|
292
|
-
end
|
293
|
-
return
|
294
|
-
end
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
|
299
|
-
def self.niko_reflection_peng_update
|
300
|
-
for event in $game_map.events.values
|
301
|
-
if event.name == "niko reflection"
|
302
|
-
event.real_y = 20*128 - ($game_player.real_y - 20*128)
|
303
|
-
event.real_x = $game_player.real_x
|
304
|
-
event.y = 20 - (($game_player.y - 20))
|
305
|
-
event.x = $game_player.x
|
306
|
-
if event.y > 19
|
307
|
-
event.y = 19
|
308
|
-
end
|
309
|
-
if event.real_y > 19*128
|
310
|
-
event.real_y = 19*128
|
311
|
-
end
|
312
|
-
|
313
|
-
if event.x > 14
|
314
|
-
event.x = 14
|
315
|
-
elsif event.x < 6
|
316
|
-
event.x = 6
|
317
|
-
end
|
318
|
-
if event.real_x > (14*128) - 32
|
319
|
-
event.real_x = (14*128) - 32
|
320
|
-
elsif event.real_x < (6*128) + 32
|
321
|
-
event.real_x = (6*128) + 32
|
322
|
-
end
|
323
|
-
|
324
|
-
return
|
325
|
-
end
|
326
|
-
end
|
327
|
-
end
|
328
|
-
|
329
|
-
# Temporary switch assignment
|
330
|
-
def self.tmp_s1=(val)
|
331
|
-
$game_switches[TMP_INDEX+0] = val
|
332
|
-
end
|
333
|
-
|
334
|
-
def self.tmp_s2=(val)
|
335
|
-
$game_switches[TMP_INDEX+1] = val
|
336
|
-
end
|
337
|
-
|
338
|
-
def self.tmp_s3=(val)
|
339
|
-
$game_switches[TMP_INDEX+2] = val
|
340
|
-
end
|
341
|
-
|
342
|
-
def self.tmp_v1=(val)
|
343
|
-
$game_variables[TMP_INDEX+0] = val
|
344
|
-
end
|
345
|
-
|
346
|
-
def self.tmp_v2=(val)
|
347
|
-
$game_variables[TMP_INDEX+1] = val
|
348
|
-
end
|
349
|
-
|
350
|
-
def self.tmp_v3=(val)
|
351
|
-
$game_variables[TMP_INDEX+2] = val
|
352
|
-
end
|
353
|
-
|
354
|
-
private
|
355
|
-
TMP_INDEX = 22
|
356
|
-
|
357
|
-
def self.logpos(pos, realpos, positive)
|
358
|
-
bigpos = pos * 128
|
359
|
-
if realpos < bigpos
|
360
|
-
return pos - 1 if positive
|
361
|
-
elsif realpos > bigpos
|
362
|
-
return pos + 1 if positive
|
363
|
-
end
|
364
|
-
return pos
|
365
|
-
end
|
366
|
-
|
367
|
-
def self.set_cam(x, y)
|
368
|
-
$game_map.display_x = x
|
369
|
-
$game_map.display_y = y
|
370
|
-
end
|
371
|
-
|
372
|
-
def self.fadein_bgm(target, speed)
|
373
|
-
$game_temp.target_bgm_vol_level = target
|
374
|
-
$game_temp.bgm_fadein_speed = speed
|
375
|
-
end
|
376
|
-
|
377
|
-
def self.copy_journal
|
378
|
-
# If the required directories don't exist, create them
|
379
|
-
Dir.mkdir(Oneshot::GAME_PATH) unless File.exists?(Oneshot::GAME_PATH)
|
380
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot")
|
381
|
-
begin
|
382
|
-
# If we're on a supported Linux DE, make a .desktop file
|
383
|
-
# so the clover icon can be properly shown
|
384
|
-
if Oneshot::OS == "linux" and SUPPORTED_DE.include? Oneshot::DE
|
385
|
-
path = "#{Oneshot::GAME_PATH}/Oneshot/#{Oneshot::JOURNAL}.desktop"
|
386
|
-
File.open(path, "wb") do |output|
|
387
|
-
output.write("[Desktop Entry]\n")
|
388
|
-
output.write("Comment=...\n")
|
389
|
-
output.write("Terminal=false\n")
|
390
|
-
output.write("Name=_______\n")
|
391
|
-
output.write("Exec=#{Dir.pwd}/#{Oneshot::JOURNAL}\n")
|
392
|
-
output.write("Type=Application\n")
|
393
|
-
output.write("Icon=#{Dir.pwd}/images/icon.png\n")
|
394
|
-
end
|
395
|
-
File.chmod(0777, path)
|
396
|
-
# If the journal is a file, copy it to Documents
|
397
|
-
elsif File.file?(Oneshot::JOURNAL)
|
398
|
-
File.open(Oneshot::JOURNAL, "rb") do |input|
|
399
|
-
File.open("#{Oneshot::GAME_PATH}/Oneshot/#{Oneshot::JOURNAL}", "wb") do |output|
|
400
|
-
while buff = input.read(4096)
|
401
|
-
output.write(buff)
|
402
|
-
end
|
403
|
-
end
|
404
|
-
end
|
405
|
-
# If the journal isn't a file, symlink it
|
406
|
-
else
|
407
|
-
File.symlink "#{Dir.pwd}/#{Oneshot::JOURNAL}", "#{Oneshot::GAME_PATH}/Oneshot/#{Oneshot::JOURNAL}"
|
408
|
-
end
|
409
|
-
rescue Errno::EACCES => e
|
410
|
-
# this probably means the clover.exe already exists and is running, so no need to create it again
|
411
|
-
rescue Errno::EEXIST => e
|
412
|
-
# this means that the journal file already exists, so no need to create it again
|
413
|
-
end
|
414
|
-
if File.exists?("README.txt")
|
415
|
-
File.open("README.txt", "rb") do |input|
|
416
|
-
File.open(Oneshot::GAME_PATH + "/Oneshot/README.txt","wb") do |output|
|
417
|
-
while buff = input.read(4096)
|
418
|
-
output.write(buff)
|
419
|
-
end
|
420
|
-
end
|
421
|
-
end
|
422
|
-
end
|
423
|
-
end
|
424
|
-
|
425
|
-
def self.create_boxes
|
426
|
-
Dir.mkdir(Oneshot::GAME_PATH) unless File.exists?(Oneshot::GAME_PATH)
|
427
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot")
|
428
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot/Portal1") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot/Portal1")
|
429
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot/Portal2") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot/Portal2")
|
430
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot/Portal3") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot/Portal3")
|
431
|
-
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot/BigPortal") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot/BigPortal")
|
432
|
-
end
|
433
|
-
|
434
|
-
def self.delete_if_exists(f_name)
|
435
|
-
File.delete(f_name) unless !File.exists?(f_name)
|
436
|
-
end
|
437
|
-
|
438
|
-
def self.clear_boxes
|
439
|
-
for i in 1..3
|
440
|
-
portal_path = Oneshot::GAME_PATH + "/Oneshot/Portal" + i.to_s
|
441
|
-
case i
|
442
|
-
when 1
|
443
|
-
delete_if_exists(portal_path + "/blue_npc_prototype.png")
|
444
|
-
delete_if_exists(portal_path + "/proto1.png")
|
445
|
-
delete_if_exists(portal_path + "/keyB.txt")
|
446
|
-
when 2
|
447
|
-
delete_if_exists(portal_path + "/green_npc_cedric.png")
|
448
|
-
delete_if_exists(portal_path + "/cedric.png")
|
449
|
-
delete_if_exists(portal_path + "/keyG.txt")
|
450
|
-
when 3
|
451
|
-
delete_if_exists(portal_path + "/red_rue.png")
|
452
|
-
delete_if_exists(portal_path + "/rue.png")
|
453
|
-
delete_if_exists(portal_path + "/keyR.txt")
|
454
|
-
end
|
455
|
-
end
|
456
|
-
delete_if_exists(Oneshot::GAME_PATH + "/Oneshot/BigPortal/keyB.txt")
|
457
|
-
delete_if_exists(Oneshot::GAME_PATH + "/Oneshot/BigPortal/keyG.txt")
|
458
|
-
delete_if_exists(Oneshot::GAME_PATH + "/Oneshot/BigPortal/keyR.txt")
|
459
|
-
end
|
460
|
-
|
461
|
-
def self.copy_file(src, dst)
|
462
|
-
begin
|
463
|
-
File.open(src, "rb") do |input|
|
464
|
-
File.open(dst,"wb") do |output|
|
465
|
-
while buff = input.read(4096)
|
466
|
-
output.write(buff)
|
467
|
-
end
|
468
|
-
end
|
469
|
-
end
|
470
|
-
rescue Errno::EACCES => e
|
471
|
-
#this probably means the file already exists and is open, so no need to create it again
|
472
|
-
rescue Errno::EEXIST => e
|
473
|
-
#this probably means the file already exists, so no need to create it again
|
474
|
-
end
|
475
|
-
end
|
476
|
-
|
477
|
-
def self.write_key(dst, str)
|
478
|
-
File.open(dst, 'w') do |file|
|
479
|
-
file.puts(str)
|
480
|
-
end
|
481
|
-
end
|
482
|
-
|
483
|
-
def self.put_key_in_box(numb)
|
484
|
-
portal_path = Oneshot::GAME_PATH + "/Oneshot/Portal" + numb.to_s
|
485
|
-
case numb
|
486
|
-
when 1
|
487
|
-
copy_file("Graphics/Characters/blue_npc_prototype.png", portal_path + "/blue_npc_prototype.png")
|
488
|
-
copy_file("Graphics/Faces/proto1.png", portal_path + "/proto1.png")
|
489
|
-
write_key(portal_path + "/keyB.txt", tr(PROTO_TEXT))
|
490
|
-
when 2
|
491
|
-
copy_file("Graphics/Characters/green_npc_cedric.png", portal_path + "/green_npc_cedric.png")
|
492
|
-
copy_file("Graphics/Faces/cedric.png", portal_path + "/cedric.png")
|
493
|
-
write_key(portal_path + "/keyG.txt", tr(CEDRIC_TEXT))
|
494
|
-
when 3
|
495
|
-
copy_file("Graphics/Characters/red_rue.png", portal_path + "/red_rue.png")
|
496
|
-
copy_file("Graphics/Faces/rue.png", portal_path + "/rue.png")
|
497
|
-
write_key(portal_path + "/keyR.txt", tr(RUE_TEXT))
|
498
|
-
end
|
499
|
-
|
500
|
-
end
|
501
|
-
|
502
|
-
def self.password1
|
503
|
-
locale = $persistent.langcode
|
504
|
-
if !Language::LANGUAGES.include? locale
|
505
|
-
locale = 'en'
|
506
|
-
end
|
507
|
-
source_dir = "Graphics/Fogs/_/scenario1/" + locale.downcase
|
508
|
-
Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
|
509
|
-
copy_file(source_dir + "/pw1.png", Oneshot::DOCS_PATH + "/ONESHOT_password1.png")
|
510
|
-
copy_file(source_dir + "/pw2.png", Oneshot::DOCS_PATH + "/ONESHOT_password2.png")
|
511
|
-
copy_file(source_dir + "/pw3.png", Oneshot::DOCS_PATH + "/ONESHOT_password3.png")
|
512
|
-
copy_file(source_dir + "/pw4.png", Oneshot::DOCS_PATH + "/ONESHOT_password4.png")
|
513
|
-
end
|
514
|
-
|
515
|
-
def self.password2
|
516
|
-
locale = $persistent.langcode
|
517
|
-
if !Language::LANGUAGES.include? locale
|
518
|
-
locale = 'en'
|
519
|
-
end
|
520
|
-
source_dir = "Graphics/Fogs/_/scenario2/#{locale.downcase}"
|
521
|
-
Dir.mkdir(Oneshot::DOCS_PATH) unless File.exists?(Oneshot::DOCS_PATH)
|
522
|
-
copy_file("#{source_dir}/pw1.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password1.png")
|
523
|
-
copy_file("#{source_dir}/pw2.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password2.png")
|
524
|
-
copy_file("#{source_dir}/pw3.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password3.png")
|
525
|
-
copy_file("#{source_dir}/pw4.png", "#{Oneshot::DOCS_PATH}/ONESHOT_password4.png")
|
526
|
-
end
|
527
|
-
|
528
|
-
=begin
|
529
|
-
def self.take_key_out_of_box(numb)
|
530
|
-
if File.exists?(Oneshot::GAME_PATH + "/Oneshot/Box" + numb.to_s + "/key" + numb.to_s + ".png")
|
531
|
-
File.delete(Oneshot::GAME_PATH + "/Oneshot/Box" + numb.to_s + "/key" + numb.to_s + ".png")
|
532
|
-
end
|
533
|
-
if File.exists?(Oneshot::GAME_PATH + "/Oneshot/BigBox/key" + numb.to_s + ".png")
|
534
|
-
File.delete(Oneshot::GAME_PATH + "/Oneshot/BigBox/key" + numb.to_s + ".png")
|
535
|
-
end
|
536
|
-
end
|
537
|
-
=end
|
538
|
-
|
539
|
-
def self.is_key_in_box(numb)
|
540
|
-
portal_path = Oneshot::GAME_PATH + "/Oneshot/Portal" + numb.to_s
|
541
|
-
case numb
|
542
|
-
when 1
|
543
|
-
return File.exists?(portal_path + "/keyB.txt")
|
544
|
-
when 2
|
545
|
-
return File.exists?(portal_path + "/keyG.txt")
|
546
|
-
when 3
|
547
|
-
return File.exists?(portal_path + "/keyR.txt")
|
548
|
-
end
|
549
|
-
return false
|
550
|
-
end
|
551
|
-
|
552
|
-
def self.is_key_in_bigbox(numb)
|
553
|
-
portal_path = Oneshot::GAME_PATH + "/Oneshot/BigPortal"
|
554
|
-
case numb
|
555
|
-
when 1
|
556
|
-
return File.exists?(portal_path + "/keyB.txt")
|
557
|
-
when 2
|
558
|
-
return File.exists?(portal_path + "/keyG.txt")
|
559
|
-
when 3
|
560
|
-
return File.exists?(portal_path + "/keyR.txt")
|
561
|
-
end
|
562
|
-
return false
|
563
|
-
end
|
564
|
-
|
565
|
-
end
|
566
|
-
|
567
|
-
def has_lightbulb?
|
568
|
-
$game_party.item_number(1) > 0
|
569
|
-
end
|
570
|
-
|
571
|
-
def button_pressed?
|
572
|
-
(1..18).each do |i|
|
573
|
-
return true if Input.trigger?(i)
|
574
|
-
end
|
575
|
-
return false
|
576
|
-
end
|
577
|
-
|
578
|
-
def enter_name
|
579
|
-
$game_temp.name_calling = true
|
580
|
-
end
|
581
|
-
|
582
|
-
def check_exit(min, max, x: -1, y: -1)
|
583
|
-
result = false
|
584
|
-
if x >= 0
|
585
|
-
if $game_player.x == x
|
586
|
-
if $game_player.y >= min && $game_player.y <= max
|
587
|
-
result = true
|
588
|
-
end
|
589
|
-
end
|
590
|
-
elsif y >= 0
|
591
|
-
if $game_player.y == y
|
592
|
-
if $game_player.x >= min && $game_player.x <= max
|
593
|
-
result = true
|
594
|
-
end
|
595
|
-
end
|
596
|
-
end
|
597
|
-
Script.tmp_s1 = $game_switches[11] ? false : result
|
598
|
-
end
|
599
|
-
|
600
|
-
def loadQASave(fname)
|
601
|
-
filename = "testing_saves/" + fname + ".rxdata"
|
602
|
-
# If file doesn't exist
|
603
|
-
unless FileTest.exist?(filename)
|
604
|
-
filename = "testing_saves_postgame/" + fname + ".rxdata"
|
605
|
-
unless FileTest.exist?(filename)
|
606
|
-
# Play buzzer SE
|
607
|
-
$game_system.se_play($data_system.buzzer_se)
|
608
|
-
return
|
609
|
-
end
|
610
|
-
end
|
611
|
-
# Play load SE
|
612
|
-
$game_system.se_play($data_system.load_se)
|
613
|
-
|
614
|
-
# Read save data
|
615
|
-
file = File.open(filename, "rb")
|
616
|
-
# Read character data for drawing save file
|
617
|
-
characters = Marshal.load(file)
|
618
|
-
# Read frame count for measuring play time
|
619
|
-
Graphics.frame_count = Marshal.load(file)
|
620
|
-
# Read each type of game object
|
621
|
-
$game_system = Marshal.load(file)
|
622
|
-
$game_switches = Marshal.load(file)
|
623
|
-
$game_variables = Marshal.load(file)
|
624
|
-
$game_self_switches = Marshal.load(file)
|
625
|
-
$game_screen = Marshal.load(file)
|
626
|
-
$game_actors = Marshal.load(file)
|
627
|
-
$game_party = Marshal.load(file)
|
628
|
-
$game_troop = Marshal.load(file)
|
629
|
-
$game_map = Marshal.load(file)
|
630
|
-
$game_player = Marshal.load(file)
|
631
|
-
$game_followers = Marshal.load(file)
|
632
|
-
$game_oneshot = Marshal.load(file)
|
633
|
-
$game_fasttravel = Marshal.load(file)
|
634
|
-
$game_temp.footstep_sfx = Marshal.load(file)
|
635
|
-
|
636
|
-
# If magic number is different from when saving
|
637
|
-
# (if editing was added with editor)
|
638
|
-
if $game_system.magic_number != $data_system.magic_number
|
639
|
-
# Load map
|
640
|
-
$game_map.setup($game_map.map_id)
|
641
|
-
$game_player.center($game_player.x, $game_player.y)
|
642
|
-
end
|
643
|
-
# Refresh party members
|
644
|
-
$game_party.refresh
|
645
|
-
|
646
|
-
f_prev = $game_player
|
647
|
-
for f in $game_followers
|
648
|
-
f.leader = f_prev
|
649
|
-
f.moveto($game_player.x, $game_player.y)
|
650
|
-
f_prev = f
|
651
|
-
end
|
652
|
-
file.close
|
653
|
-
# Restore BGM and BGS
|
654
|
-
$game_system.bgm_play($game_system.playing_bgm)
|
655
|
-
$game_system.bgs_play($game_system.playing_bgs)
|
656
|
-
# Update map (run parallel process event)
|
657
|
-
$game_map.update
|
658
|
-
# Switch to map screen
|
659
|
-
$scene = Scene_Map.new
|
660
|
-
end
|
661
|
-
|
662
|
-
def kill_perma_flags
|
663
|
-
for i in 151..175
|
664
|
-
$game_switches[i] = false
|
665
|
-
end
|
666
|
-
for i in 76..100
|
667
|
-
$game_variables[i] = 0
|
668
|
-
end
|
669
|
-
end
|
670
|
-
|
671
|
-
def bg(name)
|
672
|
-
$game_map.bg_name = name
|
673
|
-
end
|
674
|
-
|
675
|
-
def particles(type)
|
676
|
-
$game_map.particles_type = type
|
677
|
-
end
|
678
|
-
|
679
|
-
def ambient(r, g, b, gray = 0)
|
680
|
-
$game_map.ambient.set(r, g, b, gray)
|
681
|
-
end
|
682
|
-
|
683
|
-
def clear_ambient
|
684
|
-
$game_map.ambient.set(0, 0, 0, 0)
|
685
|
-
end
|
686
|
-
|
687
|
-
def add_light(id, file, intensity, x, y)
|
688
|
-
#$scene.add_light(id, file, intensity, x, y)
|
689
|
-
end
|
690
|
-
|
691
|
-
def del_light(id)
|
692
|
-
#$scene.del_light(id)
|
693
|
-
end
|
694
|
-
|
695
|
-
def clear_lights
|
696
|
-
#$scene.clear_lights
|
697
|
-
end
|
698
|
-
|
699
|
-
def wrap_map
|
700
|
-
$game_map.wrapping = true
|
701
|
-
end
|
702
|
-
|
703
|
-
def pan_offset_y(val)
|
704
|
-
$game_map.pan_offset_y = val
|
705
|
-
end
|
706
|
-
|
707
|
-
# Map specific settings
|
708
|
-
def green_ambient
|
709
|
-
ambient(-30, -20, -30)
|
710
|
-
end
|
711
|
-
|
712
|
-
def blue_ambient
|
713
|
-
ambient(-40, -40, -40)
|
714
|
-
end
|
715
|
-
|
716
|
-
def house_ambient
|
717
|
-
ambient(-15, -15, -15)
|
718
|
-
end
|
719
|
-
|
720
|
-
# Travel
|
721
|
-
def enable_travel
|
722
|
-
$game_fasttravel.enabled = true
|
723
|
-
end
|
724
|
-
|
725
|
-
def disable_travel
|
726
|
-
$game_fasttravel.enabled = false
|
727
|
-
end
|
728
|
-
|
729
|
-
def unlock_map(zone, map, dir)
|
730
|
-
# Find the coordinate of the calling event
|
731
|
-
e = $game_map.events.values.find { |e| e.name == 'FAST TRAVEL' }
|
732
|
-
raise 'could not find event named FAST TRAVEL' if !e
|
733
|
-
case dir
|
734
|
-
when :down
|
735
|
-
newdir = 2
|
736
|
-
when :left
|
737
|
-
newdir = 4
|
738
|
-
when :right
|
739
|
-
newdir = 6
|
740
|
-
when :up
|
741
|
-
newdir = 8
|
742
|
-
else
|
743
|
-
raise "invalid direction: #{dir}"
|
744
|
-
end
|
745
|
-
$game_fasttravel.enabled = true
|
746
|
-
$game_fasttravel.zone = zone
|
747
|
-
$game_fasttravel.unlock(map, $game_map.map_id, e.x, e.y, newdir)
|
748
|
-
end
|
749
|
-
|
750
|
-
# Misc
|
751
|
-
def watcher_tell_time
|
752
|
-
hour = Time.now.hour
|
753
|
-
if hour >= 6 && hour < 12
|
754
|
-
Script.tmp_v1 = 0
|
755
|
-
elsif hour >= 12 && hour < 17
|
756
|
-
Script.tmp_v1 = 1
|
757
|
-
elsif hour >= 17
|
758
|
-
Script.tmp_v1 = 2
|
759
|
-
else
|
760
|
-
Script.tmp_v1 = 3
|
761
|
-
end
|
762
|
-
end
|
763
|
-
|
764
|
-
def plight_start_timer
|
765
|
-
$game_oneshot.plight_timer = Time.now
|
766
|
-
end
|
767
|
-
|
768
|
-
def plight_update_timer
|
769
|
-
if $game_oneshot.plight_timer == nil
|
770
|
-
plight_start_timer
|
771
|
-
end
|
772
|
-
Script.tmp_v1 = ((Time.now - $game_oneshot.plight_timer) / 60).to_i
|
773
|
-
end
|
774
|
-
|
775
|
-
def activate_balcony?(ypos)
|
776
|
-
!$scene.menu_open? &&
|
777
|
-
$game_player.y == ypos &&
|
778
|
-
$game_player.direction == 8 &&
|
779
|
-
Input.trigger?(Input::ACTION) && !$game_system.map_interpreter.running? && !$game_temp.menus_visible
|
780
|
-
end
|