Mapping
This commit is contained in:
parent
c83a879570
commit
c284afdadd
6 changed files with 93 additions and 4 deletions
|
@ -440,7 +440,7 @@ int ModeAction()
|
||||||
ClearArmsData();
|
ClearArmsData();
|
||||||
ClearItemData();
|
ClearItemData();
|
||||||
//ClearPermitStage();
|
//ClearPermitStage();
|
||||||
//StartMapping();
|
StartMapping();
|
||||||
InitFlags();
|
InitFlags();
|
||||||
InitBossLife();
|
InitBossLife();
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
#include "CommonDefines.h"
|
#include "CommonDefines.h"
|
||||||
|
@ -7,9 +9,12 @@
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "KeyControl.h"
|
#include "KeyControl.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
|
#include "Stage.h"
|
||||||
#include "MyChar.h"
|
#include "MyChar.h"
|
||||||
#include "Main.h"
|
#include "Main.h"
|
||||||
|
|
||||||
|
int8_t gMapping[0x80];
|
||||||
|
|
||||||
void WriteMiniMapLine(int line)
|
void WriteMiniMapLine(int line)
|
||||||
{
|
{
|
||||||
RECT rcLevel[4];
|
RECT rcLevel[4];
|
||||||
|
@ -170,4 +175,19 @@ int MiniMapLoop()
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsMapping()
|
||||||
|
{
|
||||||
|
return gMapping[gStageNo] != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StartMapping()
|
||||||
|
{
|
||||||
|
memset(gMapping, 0, 0x80u);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetMapping(int a)
|
||||||
|
{
|
||||||
|
gMapping[a] = 1;
|
||||||
|
}
|
||||||
|
|
|
@ -1,2 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
extern int8_t gMapping[0x80];
|
||||||
|
|
||||||
int MiniMapLoop();
|
int MiniMapLoop();
|
||||||
|
bool IsMapping();
|
||||||
|
void StartMapping();
|
||||||
|
void SetMapping(int a);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "Fade.h"
|
#include "Fade.h"
|
||||||
#include "ArmsItem.h"
|
#include "ArmsItem.h"
|
||||||
#include "Flags.h"
|
#include "Flags.h"
|
||||||
|
#include "MiniMap.h"
|
||||||
#include "MyChar.h"
|
#include "MyChar.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "ValueView.h"
|
#include "ValueView.h"
|
||||||
|
@ -100,7 +101,7 @@ bool LoadProfile(char *name)
|
||||||
memcpy(gArmsData, profile.arms, sizeof(gArmsData));
|
memcpy(gArmsData, profile.arms, sizeof(gArmsData));
|
||||||
memcpy(gItemData, profile.items, sizeof(gItemData));
|
memcpy(gItemData, profile.items, sizeof(gItemData));
|
||||||
//memcpy(gPermitStage, profile.permitstage, 0x40u);
|
//memcpy(gPermitStage, profile.permitstage, 0x40u);
|
||||||
//memcpy(gMapping, profile.permit_mapping, 0x80u);
|
memcpy(gMapping, profile.permit_mapping, 0x80);
|
||||||
memcpy(gFlagNPC, profile.flags, 1000);
|
memcpy(gFlagNPC, profile.flags, 1000);
|
||||||
|
|
||||||
//Load stage
|
//Load stage
|
||||||
|
@ -148,7 +149,7 @@ bool InitializeGame()
|
||||||
ClearArmsData();
|
ClearArmsData();
|
||||||
ClearItemData();
|
ClearItemData();
|
||||||
//ClearPermitStage();
|
//ClearPermitStage();
|
||||||
//StartMapping();
|
StartMapping();
|
||||||
InitFlags();
|
InitFlags();
|
||||||
if (!TransferStage(13, 200, 10, 8))
|
if (!TransferStage(13, 200, 10, 8))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -12,6 +12,8 @@ struct STAGE_TABLE
|
||||||
char name[0x20];
|
char name[0x20];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int gStageNo;
|
||||||
|
|
||||||
bool TransferStage(int no, int w, int x, int y);
|
bool TransferStage(int no, int w, int x, int y);
|
||||||
void ChangeMusic(int no);
|
void ChangeMusic(int no);
|
||||||
void ReCallMusic();
|
void ReCallMusic();
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "Flags.h"
|
#include "Flags.h"
|
||||||
#include "Profile.h"
|
#include "Profile.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
|
#include "MiniMap.h"
|
||||||
#include "MapName.h"
|
#include "MapName.h"
|
||||||
#include "KeyControl.h"
|
#include "KeyControl.h"
|
||||||
#include "NpChar.h"
|
#include "NpChar.h"
|
||||||
|
@ -670,6 +671,18 @@ int TextScriptProc()
|
||||||
SubArmsData(z);
|
SubArmsData(z);
|
||||||
gTS.p_read += 8;
|
gTS.p_read += 8;
|
||||||
}
|
}
|
||||||
|
else if (IS_COMMAND('M','P','+'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
SetMapping(x);
|
||||||
|
gTS.p_read += 8;
|
||||||
|
}
|
||||||
|
else if (IS_COMMAND('U','N','I'))
|
||||||
|
{
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
ChangeMyUnit(z);
|
||||||
|
gTS.p_read += 8;
|
||||||
|
}
|
||||||
else if (IS_COMMAND('T','R','A'))
|
else if (IS_COMMAND('T','R','A'))
|
||||||
{
|
{
|
||||||
z = GetTextScriptNo(gTS.p_read + 4);
|
z = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
@ -859,6 +872,41 @@ int TextScriptProc()
|
||||||
else
|
else
|
||||||
gTS.p_read += 13;
|
gTS.p_read += 13;
|
||||||
}
|
}
|
||||||
|
else if (IS_COMMAND('U','N','J'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
if (GetUnitMyChar() == x)
|
||||||
|
JumpTextScript(z);
|
||||||
|
else
|
||||||
|
gTS.p_read += 13;
|
||||||
|
}
|
||||||
|
else if (IS_COMMAND('E','C','J'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
if (GetNpCharAlive(x))
|
||||||
|
JumpTextScript(z);
|
||||||
|
else
|
||||||
|
gTS.p_read += 13;
|
||||||
|
}
|
||||||
|
else if (IS_COMMAND('E','C','J'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
z = GetTextScriptNo(gTS.p_read + 9);
|
||||||
|
if (IsNpCharCode(x))
|
||||||
|
JumpTextScript(z);
|
||||||
|
else
|
||||||
|
gTS.p_read += 13;
|
||||||
|
}
|
||||||
|
else if (IS_COMMAND('M','P','J'))
|
||||||
|
{
|
||||||
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
if (IsMapping())
|
||||||
|
JumpTextScript(x);
|
||||||
|
else
|
||||||
|
gTS.p_read += 8;
|
||||||
|
}
|
||||||
else if (IS_COMMAND('S','S','S'))
|
else if (IS_COMMAND('S','S','S'))
|
||||||
{
|
{
|
||||||
x = GetTextScriptNo(gTS.p_read + 4);
|
x = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
@ -942,6 +990,17 @@ int TextScriptProc()
|
||||||
ReCallMusic();
|
ReCallMusic();
|
||||||
gTS.p_read += 4;
|
gTS.p_read += 4;
|
||||||
}
|
}
|
||||||
|
else if (IS_COMMAND('M','L','P'))
|
||||||
|
{
|
||||||
|
gTS.p_read += 4;
|
||||||
|
bExit = true;
|
||||||
|
|
||||||
|
int tscRet = MiniMapLoop();
|
||||||
|
if (tscRet == 0)
|
||||||
|
return 0;
|
||||||
|
if (tscRet == 2)
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
else if (IS_COMMAND('D','N','P'))
|
else if (IS_COMMAND('D','N','P'))
|
||||||
{
|
{
|
||||||
z = GetTextScriptNo(gTS.p_read + 4);
|
z = GetTextScriptNo(gTS.p_read + 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue