Just some thoughts on a way to put in a new damage system (plus any effects) into a weapon/shield/armor without over writing anything.
Weapons/shields/armor would have an onDamage event that would put the damage to be done to the shield or armor in a global.
They would have access to the following globals.
damage (the damage to be done after both weapon and shield/armor events happen, starts off as null)
weapon
shield
armor
attacking object
attacked object
angle hit
location hit
damage roll (how much damage the weapon would do before any modification)
shot object (for future use)
A coupler functions that would be nice to have would be.
(itmGetDamageType weapon) -> returns damage type
(itmGetResistance shield/armor damageType) -> returns the amount of damage the shield or armor would take to that damage type in the standard damage system.
The flow is a space object is hit the weapon event is called then the armor event is called and then if damage is null the standard formula is applied and damage is applied.
Any thoughts? Are there any kinds of weapon/shield/armor effects or damage systems that this could not handle? A major plus for this system is that no standard things have to be modified for modded item ondamage events.
an attempt to have an easy weapon/shield/armor system
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
Crying is not a proper retort!
You'll have to check for other weapon attributes like WMD, Ion, Radiation, passthrough.
What about checking if the object is a friend or enemy and we would finally have a 'friendly-fire' setting! That would be sweet especially for autons and wingmen.
What about checking if the object is a friend or enemy and we would finally have a 'friendly-fire' setting! That would be sweet especially for autons and wingmen.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
- Aury
- Fleet Admiral
- Posts: 5528
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
passthrough? so it hits something, deals damage, and continues going? Mind providing an in-code example? I'd like to use this.Prophet wrote:You'll have to check for other weapon attributes like WMD, Ion, Radiation, passthrough.
What about checking if the object is a friend or enemy and we would finally have a 'friendly-fire' setting! That would be sweet especially for autons and wingmen.
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
AFAIK it's only used on the Katana Starcannon.
Code: Select all
<ItemType UNID="&itStarCannon;"
name= "Katana star cannon"
level= "7"
value= "40000"
mass= "5000"
frequency= "common"
modifiers= "EnergyWeapon; MajorItem; Military; Specialty; Bushido"
description= "The star cannon fires a stream of high-energy ions. Star cannons are military weapons that cannot be used on civilian ships without a special ID."
>
<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>
<Weapon
type= "beam"
damage= "ion:4d6-1"
fireRate= "12"
lifetime= "60"
passthrough= "50"
powerUse= "600"
beamType= "starblaster"
primaryColor= "0x00, 0x80, 0xff"
secondaryColor= "0x80, 0xc0, 0xff"
sound= "&snLaserCannon;"
>
</Weapon>
</ItemType>
If you combine passthrough and WMD you have a super base cracker weapon!
I think each hit after the first deals half the damage of the previous hit (100%, 50%, 25%.....) but still very effective.
I think each hit after the first deals half the damage of the previous hit (100%, 50%, 25%.....) but still very effective.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!