[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Utilizing one magic weapon type to amp up another weapon  XML
Forum Index -> Druids RPG Development
Author Message
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

TheDruidXpawX wrote:
if we regularly see vorpal flak balls coming from any player, we will take a serious look at if you are exploiting this flaw in the RPG core 

As already discussed in this thread http://www.disastrousconsequences.com/dcforum/posts/list/2383.page, it will be quite difficult trying to police this one.

It will be difficult to decide who is actively trying to expoit different magic types, and who is just following 320s advice of "fire an avril, then a flak shell then hit with the lightning to get a triple hit on the monster before it notices you" - which is an effective technique irrespective of the magic types. It might just be coincidence that today the lightning happens to be +10 vorpal.

It is possible to check the damagetype being done against the damagetype of the current weapon, and if they are different then do not apply the magic effect, or damage bonus, of the current weapon.

The check would be best done in RPGRules.NetDamage, but since we can't change that, it will require code in each RW_ class to do the check.

So, I would suggest adding something like this to a class like OneDropRPGWeapon
Code:
static function bool CheckCorrectDamage(Weapon W, class<DamageType> DamageType)
 {
 	local int x;
 	local class<ProjectileFire> ProjFire;
 	local class<InstantFire> InstFire;
 
 	if (!ClassIsChildOf(DamageType, class'WeaponDamageType'))
 		return false;		// cannot be damage done by this weapon
 
 	for (x = 0; x < NUM_FIRE_MODES; x++)
 	{
 		if (ClassIsChildOf(W.default.FireModeClass[x], class'ProjectileFire'))
 		{
 			ProjFire = class<ProjectileFire>(W.default.FireModeClass[x]);
 			if (ProjFire != None && ProjFire.default.ProjectileClass != none 
 			  && DamageType == ProjFire.default.ProjectileClass.default.MyDamageType)
 				return true;
 		}
 		else
 		{
 			if (ClassIsChildOf(W.default.FireModeClass[x], class'InstantFire'))
 			{
 				InstFire = class<InstantFire>(W.default.FireModeClass[x]);
 				if (InstFire != None && DamageType == InstFire.default.DamageType)
 					return true;
 			}
 			else
 			{
 				if (W.default.FireMode[x] != None)
 				{
 					if ( !W.default.FireMode[x].IsA('SniperZoom') 
 					&& !W.default.FireMode[x].IsA('PainterZoom') 
 					&& !W.default.FireMode[x].IsA('CUTSRZoom')  
 					&& !W.default.FireMode[x].IsA('HeliosZoom') 
 					&& !W.default.FireMode[x].IsA('LongrifleZoom') 
 					&& !W.default.FireMode[x].IsA('PICZoom') )
 					{
 						log("some debug");
 					}
 				}
 			}
 		}
 	}
 	
 	// ok, time for the specials. Why can't things ever be simple?
 	if ( ClassIsChildOf(W.Class,class'RocketLauncher') && ClassIsChildOf(DamageType,class'DamTypeRocketHoming'))
 		return true;
 	else
 	if ( ClassIsChildOf(W.Class,class'Painter') && ClassIsChildOf(DamageType,class'DamTypeIonBlast'))
 		return true;
 	else
 	if ( ClassIsChildOf(W.Class,class'ShockRifle') && ClassIsChildOf(DamageType,class'DamTypeShockCombo'))
 		return true;
 	else
 	if ( ClassIsChildOf(W.Class,class'SniperRifle') && ClassIsChildOf(DamageType,class'DamTypeSniperHeadShot'))
 		return true;
 	else
 	if ( ClassIsChildOf(W.Class,class'ShieldGun') && ClassIsChildOf(DamageType,class'DamTypeShieldImpact'))
 		return true;
 	else
 	if ( ClassIsChildOf(W.Class,class'LinkGun') && ClassIsChildOf(DamageType,class'DamTypeLinkShaft'))
 		return true;
 	
 	log("*****CheckCorrectDamage debug: Weapon:"@W@"does not support damagetype"@DamageType);
 	return false;	// wrong damage type
 }
 


Then, each RW_ class needs to have the following lines inserted in the AdjustTargetDamage or NewAdjustTargetDamage functions (whichever is used)
Code:
		if (!class'OneDropRPGWeapon'.static.CheckCorrectDamage(ModifiedWeapon, DamageType))
 		{
 			return;
 		}
 


I may have missed a few weird combinations of weapons and damagetypes, but in principle it should work fine.

What do you reckon - worth trying?
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Okay, please don't take this the wrong way - it's not a slam on you, or your code, and I haven't really looked at it all that closely yet, but:

It looks quite hideous.

But that's more of an issue with the fact that we're talking about a hard to fix problem, and it may require some ugly code ...

Perhaps this weekend (though I'm scheduled to actually be working both days due to a deadline) I might be able to really give your code the review it deserves.

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

What's the feeling? Is this one worth continuing with?

It could perhaps be simplified to cover just the most exploitable combinations.
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

I like it. Would you commit it to the DruidsRPG module?

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

Ok, will do.
It'll take me until tomorrow to get it done.
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

Ok, in cvs.
I have updated the code for all the RW_ classes and added the test.
I have removed the old test in RW_Vorpal that checked specifically for ion painters and redeemers.
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

awesome! Thanks!

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

In OneDropWeapon, there is a log statement commented out. If you want to see the effect of the code, then uncomment the log statement, and see what it objects to.
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Szlat wrote:
In OneDropWeapon, there is a log statement commented out. If you want to see the effect of the code, then uncomment the log statement, and see what it objects to. 


Hehe. I'm guessing with that turned on, the logspam would be significant.

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
 
Forum Index -> Druids RPG Development
Go to: