MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DoSpecialPlayerStuff

Function DoSpecialPlayerStuff

Descent3/object.cpp:3084–3121  ·  view source on GitHub ↗

Do refueling centers & damage rooms

Source from the content-addressed store, hash-verified

3082
3083// Do refueling centers & damage rooms
3084void DoSpecialPlayerStuff(object *objp) {
3085 if (!OBJECT_OUTSIDE(objp)) {
3086 room *rp = &Rooms[objp->roomnum];
3087
3088 // Check for refueling
3089 if (rp->flags & RF_FUELCEN)
3090 RefuelPlayer(objp);
3091
3092 if (objp->id == Player_num && (rp->flags & RF_SECRET))
3093 DoSecretForPlayer(rp, objp);
3094
3095 // Check for damage room
3096 if (rp->damage > 0.0) {
3097 if (!(objp->effect_info->type_flags & EF_NAPALMED)) {
3098
3099 // Set the player on fire
3100 ASSERT(objp->effect_info);
3101 objp->effect_info->type_flags |= EF_NAPALMED;
3102 objp->effect_info->damage_time = 1.0;
3103 objp->effect_info->damage_per_second = rp->damage;
3104 if (Gametime - objp->effect_info->last_damage_time > 1.0f)
3105 objp->effect_info->last_damage_time = 0;
3106 objp->effect_info->damage_handle = OBJECT_HANDLE_NONE;
3107 if (objp->effect_info->sound_handle == SOUND_NONE_INDEX)
3108 objp->effect_info->sound_handle = Sound_system.Play3dSound(SOUND_PLAYER_BURNING, SND_PRIORITY_HIGHEST, objp);
3109 }
3110 }
3111
3112 // Check for & set waypoint
3113 if (rp->flags & RF_WAYPOINT)
3114 SetAutoWaypoint(objp);
3115 } else { // outside
3116
3117 // Check for & set waypoint
3118 // if (Terrain_seg[CELLNUM(objp->roomnum)].flags & TF_WAYPOINT)
3119 // SetAutoWaypoint(objp);
3120 }
3121}
3122
3123// Builds the free object list by scanning the list of free objects & adding unused ones to the list
3124// Also sets Highest_object_index

Callers 1

ObjDoFrameFunction · 0.85

Calls 4

RefuelPlayerFunction · 0.85
DoSecretForPlayerFunction · 0.85
SetAutoWaypointFunction · 0.85
Play3dSoundMethod · 0.80

Tested by

no test coverage detected