logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Hitting a bot with a ShieldBelt (Read 319 times)
Masterkent
Developer Team
Offline



Posts: 1050
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Hitting a bot with a ShieldBelt
Nov 26th, 2017 at 3:02pm
Print Post  
When a ShieldBelt absorbs some damage, it makes a specific sound. Under the current implementation, the sound is played only if the owner is a PlayerPawn:

Code
Select All
function ArmorImpactEffect(vector HitLocation)
{
	if ( Owner.IsA('PlayerPawn') )
	{
		PlayerPawn(Owner).ClientFlash(-0.05,vect(400,400,400));
		PlayerPawn(Owner).PlaySound(DeActivateSound, SLOT_None, 2.7*PlayerPawn(Owner).SoundDampening);
	}
	if ( MyEffect != None )
	{
		//MyEffect.Texture = MyEffect.LowDetailTexture;
		MyEffect.ScaleGlow = 4.0;
		MyEffect.Fatness = 255;
		SetTimer(0.8, false);
	}
} 


I find such a difference between PlayerPawns and other Pawns (including Bots which are supposed to be AI-controlled players) a bit strange. I think that the discharge sound should be played regardless of the type of the owner pawn:

Code
Select All
function ArmorImpactEffect(vector HitLocation)
{
-	if ( Owner.IsA('PlayerPawn') )
-	{
+	if (PlayerPawn(Owner) != none)
		PlayerPawn(Owner).ClientFlash(-0.05,vect(400,400,400));
+
+	if (Pawn(Owner) != none)
+		Owner.PlaySound(DeActivateSound, SLOT_None, 2.7 * Pawn(Owner).SoundDampening);
-		Owner.PlaySound(DeActivateSound, SLOT_None, 2.7*PlayerPawn(Owner).SoundDampening);
-	}
+
	if ( MyEffect != None )
	{
		//MyEffect.Texture = MyEffect.LowDetailTexture;
		MyEffect.ScaleGlow = 4.0;
		MyEffect.Fatness = 255;
		SetTimer(0.8, false);
	}
} 


Also bots should not play hit sounds & hit animations when the damage is fully absorbed by the shield, unless bot's bIsWuss is true:

Code
Select All
function PlayHit(float Damage, vector HitLocation, name damageType, float MomentumZ)
{
	local Bubble1 bub;
	local bool bOptionalTakeHit;
	local vector BloodOffset;

	if (Damage > 1) //spawn some blood
	{
		if (damageType == 'Drowned')
		{
			bub = spawn(class 'Bubble1',,, Location
			            + 0.7 * CollisionRadius * vector(ViewRotation) + 0.3 * EyeHeight * vect(0,0,1));
			if (bub != None)
				bub.DrawScale = FRand()*0.06+0.04;
		}
		else if ( damageType != 'Corroded' )
		{
			BloodOffset = 0.2 * CollisionRadius * Normal(HitLocation - Location);
			BloodOffset.Z = BloodOffset.Z * 0.5;
			spawn(class 'BloodSpray',,,hitLocation + BloodOffset, rotator(BloodOffset));
		}
	}

	bOptionalTakeHit = bIsWuss || ( (Level.TimeSeconds - LastPainTime > 0.3 + 0.25 * skill)
	                                && (Damage * FRand() > 0.08 * Health) && (Skill < 3)
	                                && (GetAnimGroup(AnimSequence) != 'MovingAttack')
	                                && (GetAnimGroup(AnimSequence) != 'Attack') );
	if ( ((Weapon == None) || !Weapon.bPointing) && (GetAnimGroup(AnimSequence) != 'Dodge')
-	        && (bOptionalTakeHit || (MomentumZ > 140)
+	        && (bOptionalTakeHit || (MomentumZ > 140 && Damage > 0)
	            || (Damage * FRand() > (0.17 + 0.04 * skill) * Health)) )
	{
		PlayTakeHitSound(Damage, damageType, 3);
		PlayHitAnim(HitLocation, Damage);
	}
-	else if (NextState == 'TakeHit')
+	else if (NextState == 'TakeHit' && Damage > 0)
	{
		PlayTakeHitSound(Damage, damageType, 2);
		NextState = '';
	}
} 

  
Back to top
 
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7698
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Hitting a bot with a ShieldBelt
Reply #1 - Nov 26th, 2017 at 3:13pm
Print Post  
again, I can only agree here Smiley
added accordingly.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
lowenz
Full Member
Betatester
***
Offline


Unreal Veteran

Posts: 174
Location: Berghem Haven
Joined: Dec 28th, 2007
Gender: Male
Re: Hitting a bot with a ShieldBelt
Reply #2 - Nov 27th, 2017 at 2:47am
Print Post  
The thread title seems a new and UNREAL ( :v ) way to damage the poor bot Cheesy Cheesy Cheesy
  

The task is not so much to see what no one has yet seen, but to think what nobody has yet thought, about that which everybody sees - E.S.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo