port: add friendly fire mp option

This commit is contained in:
Jonaeru committed 2024-03-20 01:53:50 +09:00
1 parent c9f880e427
commit 0b61ec9641
9 files changed
+65

No files matched your search

+12
View File
@@ -4339,6 +4339,18 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
return;
}
#ifndef PLATFORM_N64
// Don't damage if multiplayer and friendly fire is off
if (g_Vars.mplayerisrunning
&& !(g_MpSetup.options & MPOPTION_FRIENDLYFIRE)
&& aprop
&& aprop != vprop
&& (aprop->type == PROPTYPE_PLAYER || aprop->type == PROPTYPE_CHR)
&& chr->team == aprop->chr->team) {
return;
}
#endif
if (gset == NULL) {
gset = &gset2;
}
+4
View File
@@ -524,6 +524,10 @@ void mpInit(void)
| MPOPTION_PAC_HIGHLIGHTTARGET
| MPOPTION_PAC_SHOWONRADAR;
#ifndef PLATFORM_N64
g_MpSetup.options |= MPOPTION_FRIENDLYFIRE;
#endif
g_Vars.mphilltime = 10;
func0f187fec();
@@ -69,6 +69,14 @@ struct menuitem g_CtcOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_CHECKBOX,
+8
View File
@@ -64,6 +64,14 @@ struct menuitem g_MpCombatOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_SEPARATOR,
@@ -67,6 +67,14 @@ struct menuitem g_HtmOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_CHECKBOX,
@@ -67,6 +67,14 @@ struct menuitem g_HtbOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_CHECKBOX,
@@ -88,6 +88,14 @@ struct menuitem g_KohOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_CHECKBOX,
+8
View File
@@ -65,6 +65,14 @@ struct menuitem g_PacOptionsMenuItems[] = {
MPOPTION_SPAWNWITHWEAPON,
menuhandlerMpCheckboxOption,
},
{
MENUITEMTYPE_CHECKBOX,
0,
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
(uintptr_t)"Friendly Fire",
MPOPTION_FRIENDLYFIRE,
menuhandlerMpDisplayTeam,
},
#endif
{
MENUITEMTYPE_CHECKBOX,
+1
View File
@@ -2890,6 +2890,7 @@
#define MPOPTION_PAC_HIGHLIGHTTARGET 0x00080000
#define MPOPTION_PAC_SHOWONRADAR 0x00100000
#define MPOPTION_SPAWNWITHWEAPON 0x00200000
#define MPOPTION_FRIENDLYFIRE 0x00400000
#define MPPAUSEMODE_UNPAUSED 0
#define MPPAUSEMODE_PAUSED 1