瀏覽代碼

add default player name, resolves #30

SBird1337 6 年之前
父節點
當前提交
8a6ca2551d
共有 3 個文件被更改,包括 21 次插入0 次删除
  1. 1
    0
      main.asm
  2. 4
    0
      patches/game_engine/intro.asm
  3. 16
    0
      src/game_engine/intro_name.c

+ 1
- 0
main.asm 查看文件

@@ -64,6 +64,7 @@
64 64
 .include "patches/game_engine/localization.asm"
65 65
 .include "patches/game_engine/start_menu.asm"
66 66
 .include "patches/game_engine/script_replace.asm"
67
+.include "patches/game_engine/intro.asm"
67 68
 
68 69
 //.include "battle_engine/patches/battle_hooks.s"
69 70
 

+ 4
- 0
patches/game_engine/intro.asm 查看文件

@@ -0,0 +1,4 @@
1
+.org 0x08131754
2
+ldr r2, =name_set_hero_rival+1
3
+bx r2
4
+.pool

+ 16
- 0
src/game_engine/intro_name.c 查看文件

@@ -0,0 +1,16 @@
1
+#include <agb_debug.h>
2
+#include <pokeagb/pokeagb.h>
3
+
4
+extern pchar name_rival_male[5];
5
+extern pchar name_rival_female[5];
6
+
7
+void name_set_hero_rival(bool naming_turn_rival, u8 name_rival) {
8
+    if (!naming_turn_rival) {
9
+        pstrcpy(&saveblock2->name[0],
10
+                (saveblock2->gender == GENDER_MALE) ? &name_rival_male[0] : &name_rival_female[0]);
11
+    } else {
12
+        (void)name_rival;
13
+        pstrcpy(&saveblock1->rival_name[0],
14
+                (saveblock2->gender == GENDER_MALE) ? &name_rival_female[0] : &name_rival_male[0]);
15
+    }
16
+}