Re: Preliminary Armour System
Posted: Sun Nov 14, 2010 8:50 am
Ablative armor isn't that good anymore anyway, it'll get shredded by vulcan fire.
This forum has gone [0] days without spambot deletion.
http://www.wyrdysm.com/phpBB3/
Alright Einstein, here's the part where bullets hit armour;Silverware wrote:im not sure, if i were trusted with the code i could probibly turn out one with the change needed to the armour to show the idea off...
but meh
Code: Select all
if round(other.id.l_hp / 100) <= l_damage then
if other.id.l_hp <= l_damage then
{
with (other.id)
{
instance_destroy()
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= l_hp
}
}
}
else
{
with (other.id)
{
l_hp -= other.l_damage
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= other.l_damage
}
}
}
instance_destroy()
Code: Select all
if round(other.id.l_hp / 100) <= l_damage then
var l_threshold = 0.1 // I'm guessing that the "l_" represents local variable? A weapon must deal at least threshold * section HP to deal full damage
var l_exponent = 1 // determines how much scaling down of attack damage should be done, higher equals more severe scaling
var l_reduceddamage = l_damage * min(1, power(l_damage / (other.id.l_hp * threshold), exponent))
if other.id.l_hp <= l_reduceddamage then
{
with (other.id)
{
instance_destroy()
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= l_hp
}
}
}
else
{
with (other.id)
{
l_hp -= l_reduceddamage
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= l_reduceddamage
}
}
}
instance_destroy()
Code: Select all
tmp_ratio = l_damage/other.id.l_hp
if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
{
with (other.id)
{
l_hp -= other.l_damage
if object_get_parent(object_index) != ctr_EShip then
//Not sure about this section on either side.
//Have little idea what this actually does
{
l_owner.l_syshp -= other.l_damage
}
}
}
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
{
with (other.id)
{
l_hp -= -cos((other.tmp_ratio)*pi*(4/3))/2+0.5
if object_get_parent(object_index) != ctr_EShip then
//This may have to be edited Im not sure what its supposed to do,
//I think its supposed to reduce a portion of the SYS Hp whatever SYS is.
//if so then instead of l_hp use ((-cos((other.tmp_ratio)*pi*(4/3))/2+0.5))
{
l_owner.l_syshp -= l_hp
}
}
}
instance_destroy()
Code: Select all
if other.id.l_hp <= l_damage then
{
with (other.id)
{
instance_destroy()
Code: Select all
tmp_ratio = l_damage/other.id.l_hp
if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
{
with (other.id)
{
l_hp -= other.l_damage
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= other.l_damage
}
}
}
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
{
with (other.id)
{
l_hp -= other.l_dmg*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= other.l_dmg*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)
}
}
}
instance_destroy()
Code: Select all
tmp_ratio = l_damage/other.id.l_hp
if other.id.l_hp <= l_damage then
{
with (other.id)
{
instance_destroy()
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= l_hp
}
}
}
else if (tmp_ratio)>0.75
// If damage is at least 75% of the section hp then it will give 100% damage in
{
with (other.id)
{
l_hp -= other.l_damage
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= other.l_damage
}
}
}
else
//If the damage is less than 75% of the section hp then if will be reduced in a sort of S shape
//at about 30 - 40% the damage is reduced to about half
{
with (other.id)
{
if other.l_damage*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5) < other.l_damage/2 then other.l_damageactual = other.l_damage/2 else other.l_damageactual = other.l_damage*(-cos((other.tmp_ratio)*pi*(4/3))/2+0.5)
l_hp -= other.l_damageactual
if object_get_parent(object_index) != ctr_EShip then
{
l_owner.l_syshp -= other.l_damageactual
}
}
}
instance_destroy()
I feel I should clarify my "yeah no" from earlier.Orelius wrote:Example: have different classes of armor, ablative, light, medium, heavy. Each piece of armor has a specific durability and size constraint. ex, ablative pieces can be no larger than X by Y pixels, etc. This would make it so larger ships would have to have larger pieces of armor. In addition, it would make ablative armor less of a problem since it'll take up less space.