Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Damage Penalty vs Ship class  (Read 2557 times)

Titann

  • Commander
  • ***
  • Posts: 122
    • View Profile
Damage Penalty vs Ship class
« on: October 10, 2015, 06:02:02 AM »

Hello guys I need help!

I was triyng to make damage penalt vs Frigates,Destroyers,Cruisers,Capital_Ships hull mods

and I failed many times and I don't know what to do now.

Here how it should be;

Destroyers will have damage penalty against;
Frigates (%15)  I was writing this code for percents : stats.getHullDamageTakenMult().modifyPercent

Cruisers will have damage penalty against;
Frigates (%40)
Destroyers (%15)

Capital_Ships will have damage penalty against;
Frigates (%75)
Destroyers (%60)
Cruisers (%40)

Can someone help me with this code?

Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Damage Penalty vs Ship class
« Reply #1 on: October 10, 2015, 06:45:36 AM »

I'm pretty sure you'll have to do it the other way around: add a onHitEffect to all projectiles and a BeamEffect to all beams that does extra damage on specific ship classes. And yes that's a significant work.
Logged
 

Titann

  • Commander
  • ***
  • Posts: 122
    • View Profile
Re: Damage Penalty vs Ship class
« Reply #2 on: October 10, 2015, 07:54:11 AM »

well that stats.getHullDamageTakenMult().modifyPercent code worked actually but there was a problem

It doesnt affect other ship classes it only affects choosen one;

Frigate takes %80 less damage from every class ship
If I mount that hullmod to Destroyer, it takes %15 less damage from every class ship because of this;
      mag.put(HullSize.FRIGATE, 0f);
      mag.put(HullSize.DESTROYER, -15f);
      mag.put(HullSize.CRUISER, -65f);
      mag.put(HullSize.CAPITAL_SHIP, -98f);
so it doesnt take %98 less damage from capital ships and %65 from cruisers

it should be like this;

Destroyers should take %20 less damage from Cruisers and %60 less damage from Capital Ships

Im still new to this coding
« Last Edit: October 10, 2015, 07:57:16 AM by tokmak333 »
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: Damage Penalty vs Ship class
« Reply #3 on: October 10, 2015, 08:19:40 AM »

Yes, that's exactly what it's supposed to do. If you want to reduce the damage per classes toward specific classes, you need to do that the other way around and apply extra damage via some projectile OnHitEffect scripts.
Logged
 

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Damage Penalty vs Ship class
« Reply #4 on: October 10, 2015, 12:23:15 PM »

I suppose you are trying to make what you suggested in the thread about EVE mod. Like I said there, it involves adding a onHit script to a weapon rather than a hullmod to a ship. Actually that would be much more reasonable: capital ship with frigate-sized guns can hit frigates quite well.
Logged

Titann

  • Commander
  • ***
  • Posts: 122
    • View Profile
Re: Damage Penalty vs Ship class
« Reply #5 on: October 11, 2015, 08:51:57 AM »

Well... I think it is very hard for me and I don't really know what to do. I'll wait till someone show up with this script in his mod
Logged