1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-22 13:03:38 +00:00

Even more bugfixes

This commit is contained in:
dawnDus 2022-02-17 19:54:22 -05:00
parent 0d20b1a209
commit d49c261a17
No known key found for this signature in database
GPG key ID: 972AABDE81848F21
5 changed files with 15 additions and 10 deletions

View file

@ -208,6 +208,7 @@ pub struct AnimatedFace {
pub struct TextScriptConsts {
pub encoding: TextScriptEncoding,
pub encrypted: bool,
pub reset_invicibility_on_any_script: bool,
pub animated_face_pics: bool,
pub textbox_rect_top: Rect<u16>,
pub textbox_rect_middle: Rect<u16>,
@ -1467,6 +1468,7 @@ impl EngineConstants {
textscript: TextScriptConsts {
encoding: TextScriptEncoding::ShiftJIS,
encrypted: true,
reset_invicibility_on_any_script: true,
animated_face_pics: false,
textbox_rect_top: Rect { left: 0, top: 0, right: 244, bottom: 8 },
textbox_rect_middle: Rect { left: 0, top: 8, right: 244, bottom: 16 },
@ -1619,6 +1621,7 @@ impl EngineConstants {
self.tex_sizes.insert("MyChar".to_owned(), (200, 384));
self.tex_sizes.insert("Npc/NpcRegu".to_owned(), (320, 410));
self.tex_sizes.insert("ui".to_owned(), (128, 32));
self.textscript.reset_invicibility_on_any_script = false;
self.title.logo_rect = Rect { left: 0, top: 0, right: 214, bottom: 50 };
self.title.menu_left_top = Rect { left: 0, top: 0, right: 4, bottom: 4 };

View file

@ -11,6 +11,7 @@ pub struct ModInfo {
pub id: String,
pub requirement: Requirement,
pub priority: u32,
pub save_slot: i32,
pub path: String,
pub name: String,
pub description: String,
@ -137,11 +138,15 @@ impl ModList {
let mut name = String::new();
let mut description = String::new();
let mut save_slot = -1;
if let Ok(file) = filesystem::open(ctx, [&path, "/mod.txt"].join("")) {
let reader = BufReader::new(file);
let mut lines = reader.lines();
if let Some(line) = lines.nth(2) {
if let Some(line) = lines.nth(1) {
save_slot = line.unwrap_or("-1".to_string()).parse::<i32>().unwrap_or(-1);
}
if let Some(line) = lines.next() {
let read_name = line.unwrap_or("No Mod Name".to_string()).to_string();
name = string_table.get(&read_name).unwrap_or(&read_name).to_string();
}
@ -150,7 +155,7 @@ impl ModList {
}
}
mods.push(ModInfo { id, requirement, priority, path, name, description })
mods.push(ModInfo { id, requirement, priority, save_slot, path, name, description })
}
}

View file

@ -452,7 +452,7 @@ impl NPC {
if self.action_num == 102 {
state.npc_super_pos = (self.target_x, self.target_y);
} else {
} else if self.action_num >= 10 {
state.npc_super_pos = (self.x, self.y);
}

View file

@ -844,7 +844,7 @@ impl GameEntity<&NPCList> for Player {
return Ok(());
}
if state.textscript_vm.reset_invicibility {
if state.textscript_vm.reset_invicibility && state.constants.textscript.reset_invicibility_on_any_script {
self.shock_counter = 0;
}

View file

@ -121,6 +121,7 @@ pub struct TextScriptVM {
/// while parsing no one noticed them.
pub strict_mode: bool,
pub suspend: bool,
/// Requires `constants.textscript.reset_invicibility_on_any_script`
pub reset_invicibility: bool,
pub numbers: [u16; 4],
pub face: u16,
@ -375,7 +376,7 @@ impl TextScriptVM {
_ => {}
}
if remaining > 1 || new_line {
if remaining > 1 {
let ticks = if state.textscript_vm.flags.fast() || state.textscript_vm.flags.cutscene_skip()
{
0
@ -424,11 +425,7 @@ impl TextScriptVM {
state.textscript_vm.line_1.clear();
state.textscript_vm.line_1.append(&mut state.textscript_vm.line_2);
state.textscript_vm.line_2.append(&mut state.textscript_vm.line_3);
if remaining == 0 {
state.textscript_vm.state = TextScriptExecutionState::Running(event, ip);
} else {
state.textscript_vm.state = TextScriptExecutionState::Msg(event, ip, remaining, ticks);
}
state.textscript_vm.state = TextScriptExecutionState::Msg(event, ip, remaining, ticks);
} else {
state.textscript_vm.state =
TextScriptExecutionState::MsgNewLine(event, ip, remaining, ticks, counter);