FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DWA Fix (ADDED-CLOSED)

 
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source
View previous topic :: View next topic  
Author Message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Jun 27, 2012 7:34 am    Post subject: DWA Fix (ADDED-CLOSED) Reply with quote

Files: process_turn.php

This is in response to
http://forum.mobrulestudios.com/viewtopic.php?t=14553

DWA takes full damage from buildings?
Was proven in arena

It's my first attempt nobody laugh >.>


Code:

$unitdata[$weapon->i_on_unit]["c_type"] == "bld"


I assume that means that the type of the owner of the gun is a building?

Code to be added to line 4899

Code:

elseif ( ($unitdata[$weapon->i_on_unit]["c_type"] == "bld") AND ($unitdata[$weapon->target_id]["c_type"] == "unit") AND ($unitdata[$weapon->target_id]["i_type_id"]==56) )
{
     $unitdamage = round(0.5*$unitdamage);
}


if attacker is a building and target is a unit of id 56 (DWA), halve the damage



Frizz I couldn't find where the 'halve the damage taken by DWA from buildings' code, if it's there can you please point it out?

Also we could use some guide on the structures or classes or something

Also I couldn't submit a ticket

EDIT: this just halves the damage, doesn't add a 50% damage modifier that stacks with other modifiers. Meaning put BDII on a DWA and jur a gawd.
Might try another approach to add 50% to modifiers if Frizz asks to, maybe hax check after modifiers code or check on unit modifiers instead of just halving the damage.

Update:

Counting 50% within the 60% cap

line 4880
I assume t_damage_multiplier is related to damage reduction mods

Code:

if( ($unitdata[$weapon->i_on_unit]["c_type"] == "bld") AND ($unitdata[$weapon->target_id]["c_type"] == "unit") AND ($unitdata[$weapon->target_id]["i_type_id"]==56) )
{
     if(t_damage_multiplier-0.5<0.4)
       t_damage_multiplier=0.4;
    else t_damage_multiplier-=0.5;
}


90% cap when facing buildings

Code:

if( ($unitdata[$weapon->i_on_unit]["c_type"] == "bld") AND ($unitdata[$weapon->target_id]["c_type"] == "unit") AND ($unitdata[$weapon->target_id]["i_type_id"]==56) )
{
     if(t_damage_multiplier-0.5<0.1)
       t_damage_multiplier=0.1;
    else t_damage_multiplier-=0.5;
}


Last edited by khaibar on Wed Jun 27, 2012 11:13 am; edited 1 time in total
Back to top
View user's profile Send private message
olla
Intermediate


Joined: 15 Jun 2008
Posts: 271
Location: Switzerland

PostPosted: Wed Jun 27, 2012 9:12 am    Post subject: Reply with quote

I think, if the DWA modifier goes into the process_turn.php it needs to be before line 4881 so the damage reduction is done prior to any modifiers from mods or commands
_________________
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Jun 27, 2012 10:14 am    Post subject: Reply with quote

depends on the definition of 50% damage from buildings
is it like damage reducing mods or plane 50% of total damage

It's frizz's call, or maybe we should put it up for a vote?
Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Jun 27, 2012 11:14 am    Post subject: Reply with quote

added the code
feel free to correct if needed:)
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Wed Jun 27, 2012 11:54 am    Post subject: Reply with quote

Thank you for the line numbers ... create a TICKET next time. =)

Actually, the damage reduction on the Death Whisperer is handled by the "antid" effect:

Here's where it's set - Line: 4147
Code:
   elseif ($effect->c_type == "antid") {
      $damMod_D[$effect->i_target] += $effect->i_amount;
      if ($damMod_D[$effect->i_target] > .6) { $damMod_D[$effect->i_target] = .6; }
   }


Here's the check - Line: 4898
Code:

elseif ( ($unitdata[$weapon->target_id]["c_type"] == "bld") AND (isset($damMod_D[$weapon->target_id])) ) { $unitdamage = round((1-($damMod_D[$weapon->target_id]))*$unitdamage); }


And there's the problem: if the target is a building, then the damage reduction is applied ... it should be if the ATTACKER is a building.

Fixed:
Code:

elseif ( ($unitdata[$weapon->i_on_unit]["c_type"] == "bld") AND (isset($damMod_D[$weapon->target_id])) ) { $unitdamage = round((1-($damMod_D[$weapon->target_id]))*$unitdamage); }



Sourceforge updated, updated code added to server.

_f
_________________

Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Jun 27, 2012 12:03 pm    Post subject: Reply with quote

well looks like i was totally off lol but i guess i helped a bit

as for the antid and stuff can we have like a small catalog or something for all those words :/

I can't submit a ticket

http://forum.mobrulestudios.com/viewtopic.php?t=14697

I am facing the same issue
Back to top
View user's profile Send private message
Frizz
Site Admin


Joined: 10 Jun 2005
Posts: 3814

PostPosted: Wed Jun 27, 2012 12:08 pm    Post subject: Reply with quote

khaibar wrote:

as for the antid and stuff can we have like a small catalog or something for all those words :/



That's tied to the unit-stats file ... if this goes well that will be one of the files added.

Tickets should be working now.

_f
_________________

Back to top
View user's profile Send private message
khaibar
Advanced


Joined: 14 Dec 2007
Posts: 1141

PostPosted: Wed Jun 27, 2012 12:15 pm    Post subject: Reply with quote

I tested it on an arena and the bug is fixed
So i guess it's going well so far Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Drop Shock Forum Index -> Open Source All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group