mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Ring Shooter: add a 2 second cooldown after respawning before you can touch a Ring Shooter
This does not prevent you from using the respawn button to summon a Ring Shooter. - Ring Shooter only tracks the last player who touched it, to prevent that player from reusing it - If another player touches the Ring Shooter, it loses track of the original user - Near a Block Lightsnake waypoint, this would enter an endless loop where both players are able to touch the Ring Shooter and use it to respawn, placing them right above the Ring Shooter (and the cycle repeats)
This commit is contained in:
		
							parent
							
								
									e1db54198f
								
							
						
					
					
						commit
						4ccb9b22c8
					
				
					 4 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -952,6 +952,7 @@ struct player_t
 | 
			
		|||
	UINT16 infinitether; // Generic infinitether time, used for infinitether leniency.
 | 
			
		||||
 | 
			
		||||
	UINT8 finalfailsafe; // When you can't Ringshooter, force respawn as a last ditch effort!
 | 
			
		||||
	UINT8 freeRingShooterCooldown; // Can't use a free Ring Shooter again too soon after respawning.
 | 
			
		||||
 | 
			
		||||
	UINT8 lastsafelap;
 | 
			
		||||
	UINT8 lastsafecheatcheck;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8738,6 +8738,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
 | 
			
		|||
		player->finalfailsafe = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (player->freeRingShooterCooldown && !player->mo->hitlag)
 | 
			
		||||
		player->freeRingShooterCooldown--;
 | 
			
		||||
 | 
			
		||||
	if (player->superring)
 | 
			
		||||
	{
 | 
			
		||||
		player->nextringaward++;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -885,6 +885,9 @@ static void K_HandleDropDash(player_t *player)
 | 
			
		|||
		player->respawn.state = RESPAWNST_NONE;
 | 
			
		||||
 | 
			
		||||
		player->mo->flags &= ~(MF_NOCLIPTHING);
 | 
			
		||||
 | 
			
		||||
		// Don't touch another Ring Shooter (still lets you summon a Ring Shooter yourself)
 | 
			
		||||
		player->freeRingShooterCooldown = 2*TICRATE;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -915,7 +915,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
 | 
			
		|||
			return;
 | 
			
		||||
 | 
			
		||||
		case MT_RINGSHOOTER:
 | 
			
		||||
			Obj_PlayerUsedRingShooter(special, player);
 | 
			
		||||
			if (player->freeRingShooterCooldown)
 | 
			
		||||
				player->pflags |= PF_CASTSHADOW; // you can't use this right now!
 | 
			
		||||
			else
 | 
			
		||||
				Obj_PlayerUsedRingShooter(special, player);
 | 
			
		||||
			return;
 | 
			
		||||
 | 
			
		||||
		case MT_SUPER_FLICKY:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue