Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
SRB2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
264
Issues
264
List
Board
Labels
Milestones
Merge Requests
82
Merge Requests
82
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
STJr
SRB2
Commits
9e4c519c
Commit
9e4c519c
authored
Jan 19, 2020
by
Tatsuru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In-map visual indicator
parent
e9a8c2d2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
4 deletions
+108
-4
d_netcmd.c
src/d_netcmd.c
+9
-3
dehacked.c
src/dehacked.c
+4
-0
hw_light.c
src/hardware/hw_light.c
+1
-0
info.c
src/info.c
+32
-1
info.h
src/info.h
+5
-0
p_local.h
src/p_local.h
+1
-0
p_mobj.c
src/p_mobj.c
+29
-0
p_user.c
src/p_user.c
+27
-0
No files found.
src/d_netcmd.c
View file @
9e4c519c
...
...
@@ -3736,9 +3736,15 @@ static void ExitMove_OnChange(void)
if
(
cv_exitmove
.
value
)
{
for
(
i
=
0
;
i
<
MAXPLAYERS
;
++
i
)
if
(
playeringame
[
i
]
&&
players
[
i
].
mo
&&
players
[
i
].
mo
->
target
&&
players
[
i
].
mo
->
target
->
type
==
MT_SIGN
)
P_SetTarget
(
&
players
[
i
].
mo
->
target
,
NULL
);
if
(
playeringame
[
i
]
&&
players
[
i
].
mo
)
{
if
(
players
[
i
].
mo
->
target
&&
players
[
i
].
mo
->
target
->
type
==
MT_SIGN
)
P_SetTarget
(
&
players
[
i
].
mo
->
target
,
NULL
);
if
(
players
[
i
].
pflags
&
PF_FINISHED
)
P_GiveFinishFlags
(
&
players
[
i
]);
}
CONS_Printf
(
M_GetText
(
"Players can now move after completing the level.
\n
"
));
}
else
...
...
src/dehacked.c
View file @
9e4c519c
...
...
@@ -7482,6 +7482,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// Got Flag Sign
"S_GOTFLAG"
,
// Finish flag
"S_FINISHFLAG"
,
"S_CORK"
,
"S_LHRT"
,
...
...
@@ -8601,6 +8604,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_LOCKONINF"
,
// In-level Target
"MT_TAG"
,
// Tag Sign
"MT_GOTFLAG"
,
// Got Flag sign
"MT_FINISHFLAG"
,
// Finish flag
// Ambient Sounds
"MT_AWATERA"
,
// Ambient Water Sound 1
...
...
src/hardware/hw_light.c
View file @
9e4c519c
...
...
@@ -509,6 +509,7 @@ light_t *t_lspr[NUMSPRITES] =
&
lspr
[
NOLIGHT
],
// SPR_LCKN
&
lspr
[
NOLIGHT
],
// SPR_TTAG
&
lspr
[
NOLIGHT
],
// SPR_GFLG
&
lspr
[
NOLIGHT
],
// SPR_FNSF
&
lspr
[
NOLIGHT
],
// SPR_CORK
&
lspr
[
NOLIGHT
],
// SPR_LHRT
...
...
src/info.c
View file @
9e4c519c
...
...
@@ -407,6 +407,7 @@ char sprnames[NUMSPRITES + 1][5] =
"LCKN"
,
// Target
"TTAG"
,
// Tag Sign
"GFLG"
,
// Got Flag sign
"FNSF"
,
// Finish flag
"CORK"
,
"LHRT"
,
...
...
@@ -3348,7 +3349,10 @@ state_t states[NUMSTATES] =
{
SPR_TTAG
,
FF_FULLBRIGHT
,
2
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_TTAG
// CTF Sign
{
SPR_GFLG
,
FF_FULLBRIGHT
,
2
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_GOTFLAG
{
SPR_GFLG
,
FF_FULLBRIGHT
,
2
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_GOTFLAG
// Finish flag
{
SPR_FNSF
,
FF_TRANS30
,
-
1
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_FINISHFLAG
{
SPR_CORK
,
0
,
-
1
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_CORK
{
SPR_LHRT
,
FF_FULLBRIGHT
,
-
1
,
{
NULL
},
0
,
0
,
S_NULL
},
// S_LHRT
...
...
@@ -17994,6 +17998,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
MF_NOBLOCKMAP
|
MF_NOCLIP
|
MF_NOGRAVITY
|
MF_SCENERY
,
// flags
S_NULL
// raisestate
},
{
// MT_FINISHFLAG
-
1
,
// doomednum
S_FINISHFLAG
,
// spawnstate
1000
,
// spawnhealth
S_NULL
,
// seestate
sfx_None
,
// seesound
8
,
// reactiontime
sfx_None
,
// attacksound
S_NULL
,
// painstate
0
,
// painchance
sfx_None
,
// painsound
S_NULL
,
// meleestate
S_NULL
,
// missilestate
S_NULL
,
// deathstate
S_NULL
,
// xdeathstate
sfx_None
,
// deathsound
4
*
FRACUNIT
,
// speed
8
*
FRACUNIT
,
// radius
8
*
FRACUNIT
,
// height
1
,
// display offset
16
,
// mass
0
,
// damage
sfx_None
,
// activesound
MF_NOBLOCKMAP
|
MF_NOCLIP
|
MF_NOGRAVITY
|
MF_SCENERY
,
// flags
S_NULL
// raisestate
},
// ambient water 1a (large)
{
// MT_AWATERA
...
...
src/info.h
View file @
9e4c519c
...
...
@@ -670,6 +670,7 @@ typedef enum sprite
SPR_LCKN
,
// Target
SPR_TTAG
,
// Tag Sign
SPR_GFLG
,
// Got Flag sign
SPR_FNSF
,
// Finish flag
SPR_CORK
,
SPR_LHRT
,
...
...
@@ -3484,6 +3485,9 @@ typedef enum state
// Got Flag Sign
S_GOTFLAG
,
// Finish flag
S_FINISHFLAG
,
S_CORK
,
S_LHRT
,
...
...
@@ -4625,6 +4629,7 @@ typedef enum mobj_type
MT_LOCKONINF
,
// In-level Target
MT_TAG
,
// Tag Sign
MT_GOTFLAG
,
// Got Flag sign
MT_FINISHFLAG
,
// Finish flag
// Ambient Sounds
MT_AWATERA
,
// Ambient Water Sound 1
...
...
src/p_local.h
View file @
9e4c519c
...
...
@@ -159,6 +159,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives);
void
P_GiveCoopLives
(
player_t
*
player
,
INT32
numlives
,
boolean
sound
);
UINT8
P_GetNextEmerald
(
void
);
void
P_GiveEmerald
(
boolean
spawnObj
);
void
P_GiveFinishFlags
(
player_t
*
player
);
#if 0
void P_ResetScore(player_t *player);
#else
...
...
src/p_mobj.c
View file @
9e4c519c
...
...
@@ -8006,6 +8006,32 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if
(
strength
<
10
)
mobj
->
frame
|=
((
10
-
strength
)
<<
(
FF_TRANSSHIFT
));
}
case
MT_FINISHFLAG
:
{
if
(
!
mobj
->
target
||
mobj
->
target
->
player
->
playerstate
==
PST_DEAD
||
!
cv_exitmove
.
value
)
{
P_RemoveMobj
(
mobj
);
return
;
}
if
(
!
camera
.
chase
)
mobj
->
flags2
|=
MF2_DONTDRAW
;
else
mobj
->
flags2
&=
~
MF2_DONTDRAW
;
fixed_t
radius
=
FixedMul
(
10
*
mobj
->
info
->
speed
,
mobj
->
target
->
scale
);
mobj
->
angle
+=
FixedAngle
(
mobj
->
info
->
speed
);
angle_t
fa
=
mobj
->
angle
>>
ANGLETOFINESHIFT
;
P_UnsetThingPosition
(
mobj
);
mobj
->
x
=
mobj
->
target
->
x
+
FixedMul
(
FINECOSINE
(
fa
),
radius
);
mobj
->
y
=
mobj
->
target
->
y
+
FixedMul
(
FINESINE
(
fa
),
radius
);
mobj
->
z
=
mobj
->
target
->
z
+
mobj
->
target
->
height
/
2
;
P_SetThingPosition
(
mobj
);
P_SetScale
(
mobj
,
mobj
->
target
->
scale
);
}
/* FALLTHRU */
default:
if
(
mobj
->
fuse
)
...
...
@@ -11512,6 +11538,9 @@ void P_AfterPlayerSpawn(INT32 playernum)
if
(
CheckForReverseGravity
)
P_CheckGravity
(
mobj
,
false
);
if
(
p
->
pflags
&
PF_FINISHED
)
P_GiveFinishFlags
(
p
);
}
// spawn it at a playerspawn mapthing
...
...
src/p_user.c
View file @
9e4c519c
...
...
@@ -370,6 +370,32 @@ void P_GiveEmerald(boolean spawnObj)
}
}
//
// P_GiveFinishFlags
//
// Give the player visual indicators
// that they've finished the map.
//
void
P_GiveFinishFlags
(
player_t
*
player
)
{
if
(
!
player
->
mo
)
return
;
angle_t
angle
=
FixedAngle
(
player
->
mo
->
angle
<<
FRACBITS
);
for
(
UINT8
i
=
0
;
i
<
3
;
i
++
)
{
angle_t
fa
=
(
angle
>>
ANGLETOFINESHIFT
)
&
FINEMASK
;
fixed_t
xoffs
=
FINECOSINE
(
fa
);
fixed_t
yoffs
=
FINESINE
(
fa
);
mobj_t
*
flag
=
P_SpawnMobjFromMobj
(
player
->
mo
,
xoffs
,
yoffs
,
0
,
MT_FINISHFLAG
);
flag
->
angle
=
angle
;
angle
+=
FixedAngle
(
120
*
FRACUNIT
);
P_SetTarget
(
&
flag
->
target
,
player
->
mo
);
}
}
#if 0
//
// P_ResetScore
...
...
@@ -2171,6 +2197,7 @@ void P_DoPlayerFinish(player_t *player)
return
;
player
->
pflags
|=
PF_FINISHED
;
P_GiveFinishFlags
(
player
);
if
(
netgame
)
CONS_Printf
(
M_GetText
(
"%s has completed the level.
\n
"
),
player_names
[
player
-
players
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment