Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire subsystem mk 1 #10

Merged
merged 20 commits into from Mar 1, 2015

Conversation

Projects
None yet
2 participants
@fejoa
Copy link
Member

fejoa commented Mar 1, 2015

Somebody merge these changes.

fejoa added some commits Jul 13, 2014

Added some code to enable the following functionality:
- objects now have a property where they are burning. It is a kind of state
- sticks can be (a)pplied and when they are, they commence burning
- when an object is burning, flames appear
- burning objects cannot be piled together with objects that are not burning
- an object that is burning will emit light
- in ivandef.h and define.dat added the following to denote in how far an item is burnt:
#define NOT_BURNT 0
#define SLIGHTLY_BURNT 1
#define MODERATELY_BURNT 2
#define HEAVILY_BURNT 3

known bugs include that the second item of an item generated in pairs (f.ex. boot, gauntlet) does not have its burning state set to zero initially. Not a dreadful problem at the moment. It just looks like it is on fire, but does not emit light... funny.
Warning: this revision has a bug somewhere!
Commit for the sake of saving a version. Need to revert back to an earlier version to check why the changes in this version are giving bugs.

Right now, the changes are about causing an item to burn while it is on fire, using a mixture of Spoiling which needs a Be() for "burning" things over time and rusting, which stores the rust data for a material efficiently.
Materials now "Burn", if they are burning, and go through the stages …
…not burnt, slightly burnt, moderately burnt and heavily burnt.

This approach uses a mixture of Spoiling which needs a Be() for "burning" things over time and Rusting, which stores the rust data for a material efficiently. There was an earlier bug because of missing line in bodypart.h:
virtual truth AddBurnLevelDescription(festring&, truth) const { return false; }

This paves the way for the bitmaps to be manipulated as per RustData.
There is also a change to the way items become burnt. The material gets burnt instead. This means it is now conceptually correct.

Known issue:
With the changes to the Burn level description, things are no longer piling properly anymore, so this needs to be attended to at some point.
Merge branch 'warheck-sandbox' of https://github.com/Attnam/ivan into…
… warheck-sandbox

Conflicts:
	Main/Source/materias.cpp
In this commit, the strength value of the material decreases accordin…
…g to its degree of burnedness (NOT_BURNT, MODERATELY_BURNT etc.). This function works in the same way as it does in the rust system.
In this edition, an individual item's activation energy is tested whe…
…n an item receives FIRE damage (i.e. due to an explosion). If the damage done is greater or equal to (2*MaterialStrength + 10*(MaterialFireResistance + ItemFireResistance)), then there is a chance that it will "catch fire".

Fire resistances have been added for materials.
Added the visuals for items after they ignite. Only ignition source i…
…s due to explosions so far. Not sure if the Activation Energy for items should be lowered, but if it is too low then the whole dungeon will ignite.

Wood materials, Balsa wood up to and including ebony wood, can now burn (interaction flags in material.dat have been updated to include CAN_BURN).
In this commit, it seems the random boot or gauntlet in a wished pair is no longer burning, so that provisional bug is provisionally fixed. (see changes to object.h)
Objects are destroyed once they are completely burnt up, as per spoil…
…ing, rusting subsystems.

Also provisionally revised the activation energy formula for triggering flame ignition via explosions. This still needs to be balanced out properly.
Updated the Activation energy threshold to the following formula:
ActivationEnergy = 0.5 x MaterialStrength + 5 x MaterialFireResistance + FireResistanceItemEnchantment

Revised the FireResistance of all materials
Updated the Activation energy threshold to the following formula:
ActivationEnergy = 0.5 x MaterialStrength + 5 x MaterialFireResistance + FireResistanceItemEnchantment

Revised the FireResistance of all materials

Different materials now have different burn times
Different materials now have different burn times. Introduced a BurnM…
…odifier() which determines the duration of burning based on material strength, fire resistance and density, according to the formula (500 + Den + ((Str * FR) >> 1))

Made it so that the words "(on fire)" appear in the post-fix of meleeweapons and armors that are on fire, a la fluids (covered in ...)

Prevented wooden flaming swords from catching fire. Achieved this via CanBeBurned in item.h and item.dat and test condition in item::ReceiveDamage
Caused burning phoenix feather to reset and stop burning once it gets completely burnt. Wondering if this needs a separate message.

Introduced code for extinguishing flames via the function Extinguish() (opposite function to Ignite()) - wielded equipment graphics still do not extinguish for some reason

Ghosts, powder, fluids were all burning. Even the snow in Attnam was on fire! This was fixed by adding "virtual int IsBurning() const { return 0; }" to liquids (therefore powders) and gasses. Not an ideal means of fixing this. it should really be fixed at the level of object.h
Merge branch 'warheck-sandbox' of https://github.com/Attnam/ivan into…
… warheck-sandbox

Conflicts:
	Script/material.dat
BOOM! Graded charring in the bitmap, achieved by selecting the RGB co…
…lour with the max intensity, RSHIFT max intensity by 2, RSHIFT old RGB by 3 and then add these together with Max>>2 to form the new 'burnt' RGB values
Intoduced new material variables of Transient and Steady State therma…
…l energy. Transient is responsible for enabling damage from multiple explosions to accumulate, triggering higher thresholds of activation energy for materials like dragon hide, etc. Transient stored energy de-accumulates with the Be() function. Steady state stores the accumulated energy and is decremented only when the burning object is in contact with a fluid, f. ex. water. once Steady State reached zero, then the flames on the object are extinguished.

There is an extinguish function for putting out flames on objects that are on fire. Extinguish() needs to be properly generalised so that the thermal energies reach zero when this function is called (another thing for the to-do list).
Phoenix feather materials "rise from the ashes" upon complete combustion
Meleeweapons can be dipped when on fire, no fluid, and not both.
Armors can now be dipped but only when on fire and no other fluid is present (interesting to check this during actual melee, when blood is spilled, does it put out flames?)
Beartraps can be dipped in liquids (poison/acid for instance). Don't know if this is a good idea...
Made it so that books and scrolls catch fire like normal items do, bu…
…t only after being tested for instantly burning away. Changed the in-game messages accordingly. Scrolls are no longer readable if they are burnt (burnt scrolls are unusable if they are not wholly legible.

Burnt scrolls are illegible, unless you are intelligent enough to decipher them
Burning books and scrolls should be dippable into various liquids now, and thus assist in frantic firefighting
Removed changes to dipping beartraps in poison etc, because this is not related to the fire subsystem, and it was a little half-baked IMO
Made it possible to fix burnt items, albeit via the Tailor alone, for things like burnt leather (Ikiros only fixes items made of metal).
Burnt limbs are as expensive as rusted limbs to fix (at the time of writing, bodyparts do not burn).
Made it more likely for raindrops, vomit to put out fires. Needs quite a lot of raindrops, and at the moment, normal items do not accumulate raindrops via this mechanism, only gears etc. This is because of this line in stack.cpp: ItemVector[c]->AllowFluids()
You can actually put the flames out on f. ex. a burning wooden sword, by using it against blood spilling foes (blood puts out flames).
- Solids no longer sparkle when they are burnt, but do again when the…
…y are repaired. N.B.: There are no sparkly solids that burn!!! So this is for posterity only.

- Found that materials no longer sparkle if dipped in fluids, and no longer resume sparkling even after the fluid has evaporated - which is a BUG!
- Invented a function that resets the thermal energies and included this function call wherever Extinguish() is called (some tidying up).
- Fixed a provisional bug where scrolls and books could be dipped without being on fire

@fejoa fejoa added this to the IVAN 0.51 milestone Mar 1, 2015

andrewtweber pushed a commit that referenced this pull request Mar 1, 2015

Andrew Weber

@andrewtweber andrewtweber merged commit 0eb8978 into IVAN051-develop Mar 1, 2015

fejoa pushed a commit that referenced this pull request May 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.