mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'wall-transfer-everything' into 'master'
Wall transfer Orbinauts, Jawz, Ballhogs (and literally every object) See merge request KartKrew/Kart!701
This commit is contained in:
		
						commit
						e8f75be938
					
				
					 2 changed files with 76 additions and 78 deletions
				
			
		|  | @ -13209,7 +13209,6 @@ void A_ItemPop(mobj_t *actor) | ||||||
| 
 | 
 | ||||||
| void A_JawzChase(mobj_t *actor) | void A_JawzChase(mobj_t *actor) | ||||||
| { | { | ||||||
| 	const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy); |  | ||||||
| 	player_t *player; | 	player_t *player; | ||||||
| 	fixed_t thrustamount = 0; | 	fixed_t thrustamount = 0; | ||||||
| 	fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction; | 	fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction; | ||||||
|  | @ -13294,30 +13293,29 @@ void A_JawzChase(mobj_t *actor) | ||||||
| 			P_SetTarget(&actor->tracer, NULL); | 			P_SetTarget(&actor->tracer, NULL); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (!P_IsObjectOnGround(actor)) |  | ||||||
| 	{ |  | ||||||
| 		// No friction in the air
 |  | ||||||
| 		frictionsafety = FRACUNIT; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (currentspeed >= topspeed) |  | ||||||
| 	{ |  | ||||||
| 		// Thrust as if you were at top speed, slow down naturally
 |  | ||||||
| 		thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; |  | ||||||
| 	} |  | ||||||
| 	else |  | ||||||
| 	{ |  | ||||||
| 		const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; |  | ||||||
| 		// Thrust to immediately get to top speed
 |  | ||||||
| 		thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (!actor->tracer) | 	if (!actor->tracer) | ||||||
| 	{ | 	{ | ||||||
| 		actor->angle = K_MomentumAngle(actor); | 		actor->angle = K_MomentumAngle(actor); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	P_Thrust(actor, actor->angle, thrustamount); | 	if (P_IsObjectOnGround(actor)) | ||||||
|  | 	{ | ||||||
|  | 		const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy); | ||||||
|  | 
 | ||||||
|  | 		if (currentspeed >= topspeed) | ||||||
|  | 		{ | ||||||
|  | 			// Thrust as if you were at top speed, slow down naturally
 | ||||||
|  | 			thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; | ||||||
|  | 		} | ||||||
|  | 		else | ||||||
|  | 		{ | ||||||
|  | 			const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; | ||||||
|  | 			// Thrust to immediately get to top speed
 | ||||||
|  | 			thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety); | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		P_Thrust(actor, actor->angle, thrustamount); | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	if ((actor->tracer != NULL) && (actor->tracer->health > 0)) | 	if ((actor->tracer != NULL) && (actor->tracer->health > 0)) | ||||||
| 		return; | 		return; | ||||||
|  |  | ||||||
							
								
								
									
										116
									
								
								src/p_mobj.c
									
										
									
									
									
								
							
							
						
						
									
										116
									
								
								src/p_mobj.c
									
										
									
									
									
								
							|  | @ -1594,21 +1594,7 @@ void P_XYMovement(mobj_t *mo) | ||||||
| 		else if (P_MobjWasRemoved(mo)) | 		else if (P_MobjWasRemoved(mo)) | ||||||
| 			return; | 			return; | ||||||
| 
 | 
 | ||||||
| 		//{ SRB2kart - Jawz
 | 		if (mo->flags & MF_MISSILE) | ||||||
| 		if (mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD) |  | ||||||
| 		{ |  | ||||||
| 			if (mo->health == 1) |  | ||||||
| 			{ |  | ||||||
| 				// This Item Damage
 |  | ||||||
| 				S_StartSound(mo, mo->info->deathsound); |  | ||||||
| 				P_KillMobj(mo, NULL, NULL, DMG_NORMAL); |  | ||||||
| 
 |  | ||||||
| 				P_SetObjectMomZ(mo, 8*FRACUNIT, false); |  | ||||||
| 				P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT); |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		//}
 |  | ||||||
| 		else if (mo->flags & MF_MISSILE) |  | ||||||
| 		{ | 		{ | ||||||
| 			// explode a missile
 | 			// explode a missile
 | ||||||
| 			if (P_CheckSkyHit(mo)) | 			if (P_CheckSkyHit(mo)) | ||||||
|  | @ -1671,7 +1657,7 @@ void P_XYMovement(mobj_t *mo) | ||||||
| 		{ | 		{ | ||||||
| 			boolean walltransferred = false; | 			boolean walltransferred = false; | ||||||
| 
 | 
 | ||||||
| 			if (player || mo->flags & MF_SLIDEME) | 			//if (player || mo->flags & MF_SLIDEME)
 | ||||||
| 			{ // try to slide along it
 | 			{ // try to slide along it
 | ||||||
| 				// Wall transfer part 1.
 | 				// Wall transfer part 1.
 | ||||||
| 				pslope_t *transferslope = NULL; | 				pslope_t *transferslope = NULL; | ||||||
|  | @ -1745,23 +1731,32 @@ void P_XYMovement(mobj_t *mo) | ||||||
| 						fx->scale = mo->scale; | 						fx->scale = mo->scale; | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					if (mo->type == MT_ORBINAUT) // Orbinaut speed decreasing
 | 					switch (mo->type) | ||||||
| 					{ | 					{ | ||||||
| 						if (mo->health > 1) | 						case MT_ORBINAUT: // Orbinaut speed decreasing
 | ||||||
| 						{ | 							if (mo->health > 1) | ||||||
| 							S_StartSound(mo, mo->info->attacksound); | 							{ | ||||||
| 							mo->health--; | 								S_StartSound(mo, mo->info->attacksound); | ||||||
| 							mo->threshold = 0; | 								mo->health--; | ||||||
| 						} | 								mo->threshold = 0; | ||||||
| 						else if (mo->health == 1) | 							} | ||||||
| 						{ | 							/*FALLTHRU*/ | ||||||
| 							// This Item Damage
 |  | ||||||
| 							S_StartSound(mo, mo->info->deathsound); |  | ||||||
| 							P_KillMobj(mo, NULL, NULL, DMG_NORMAL); |  | ||||||
| 
 | 
 | ||||||
| 							P_SetObjectMomZ(mo, 8*FRACUNIT, false); | 						case MT_JAWZ: | ||||||
| 							P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT); | 						case MT_JAWZ_DUD: | ||||||
| 						} | 							if (mo->health == 1) | ||||||
|  | 							{ | ||||||
|  | 								// This Item Damage
 | ||||||
|  | 								S_StartSound(mo, mo->info->deathsound); | ||||||
|  | 								P_KillMobj(mo, NULL, NULL, DMG_NORMAL); | ||||||
|  | 
 | ||||||
|  | 								P_SetObjectMomZ(mo, 8*FRACUNIT, false); | ||||||
|  | 								P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT); | ||||||
|  | 							} | ||||||
|  | 							break; | ||||||
|  | 
 | ||||||
|  | 						default: | ||||||
|  | 							break; | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					// Bubble bounce
 | 					// Bubble bounce
 | ||||||
|  | @ -6739,40 +6734,45 @@ static boolean P_MobjRegularThink(mobj_t *mobj) | ||||||
| 		} | 		} | ||||||
| 		else | 		else | ||||||
| 		{ | 		{ | ||||||
| 			fixed_t finalspeed = mobj->movefactor; |  | ||||||
| 			const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); |  | ||||||
| 			fixed_t thrustamount = 0; |  | ||||||
| 			fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; |  | ||||||
| 			mobj_t *ghost = P_SpawnGhostMobj(mobj); | 			mobj_t *ghost = P_SpawnGhostMobj(mobj); | ||||||
| 			ghost->colorized = true; // already has color!
 | 			ghost->colorized = true; // already has color!
 | ||||||
| 
 | 
 | ||||||
| 			if (!grounded) |  | ||||||
| 			{ |  | ||||||
| 				// No friction in the air
 |  | ||||||
| 				frictionsafety = FRACUNIT; |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 			mobj->angle = K_MomentumAngle(mobj); | 			mobj->angle = K_MomentumAngle(mobj); | ||||||
| 			if (mobj->health <= 5) |  | ||||||
| 			{ |  | ||||||
| 				INT32 i; |  | ||||||
| 				for (i = 5; i >= mobj->health; i--) |  | ||||||
| 					finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); |  | ||||||
| 			} |  | ||||||
| 
 | 
 | ||||||
| 			if (currentspeed >= finalspeed) | 			if (P_IsObjectOnGround(mobj)) | ||||||
| 			{ | 			{ | ||||||
| 				// Thrust as if you were at top speed, slow down naturally
 | 				fixed_t finalspeed = mobj->movefactor; | ||||||
| 				thrustamount = FixedDiv(finalspeed, frictionsafety) - finalspeed; | 				const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); | ||||||
| 			} | 				fixed_t thrustamount = 0; | ||||||
| 			else | 				fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; | ||||||
| 			{ |  | ||||||
| 				const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; |  | ||||||
| 				// Thrust to immediately get to top speed
 |  | ||||||
| 				thrustamount = beatfriction + FixedDiv(finalspeed - currentspeed, frictionsafety); |  | ||||||
| 			} |  | ||||||
| 
 | 
 | ||||||
| 			P_Thrust(mobj, mobj->angle, thrustamount); | 				if (!grounded) | ||||||
|  | 				{ | ||||||
|  | 					// No friction in the air
 | ||||||
|  | 					frictionsafety = FRACUNIT; | ||||||
|  | 				} | ||||||
|  | 
 | ||||||
|  | 				if (mobj->health <= 5) | ||||||
|  | 				{ | ||||||
|  | 					INT32 i; | ||||||
|  | 					for (i = 5; i >= mobj->health; i--) | ||||||
|  | 						finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); | ||||||
|  | 				} | ||||||
|  | 
 | ||||||
|  | 				if (currentspeed >= finalspeed) | ||||||
|  | 				{ | ||||||
|  | 					// Thrust as if you were at top speed, slow down naturally
 | ||||||
|  | 					thrustamount = FixedDiv(finalspeed, frictionsafety) - finalspeed; | ||||||
|  | 				} | ||||||
|  | 				else | ||||||
|  | 				{ | ||||||
|  | 					const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; | ||||||
|  | 					// Thrust to immediately get to top speed
 | ||||||
|  | 					thrustamount = beatfriction + FixedDiv(finalspeed - currentspeed, frictionsafety); | ||||||
|  | 				} | ||||||
|  | 
 | ||||||
|  | 				P_Thrust(mobj, mobj->angle, thrustamount); | ||||||
|  | 			} | ||||||
| 
 | 
 | ||||||
| 			if (P_MobjTouchingSectorSpecial(mobj, 3, 1, true)) | 			if (P_MobjTouchingSectorSpecial(mobj, 3, 1, true)) | ||||||
| 				K_DoPogoSpring(mobj, 0, 1); | 				K_DoPogoSpring(mobj, 0, 1); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Oni
						Oni