Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: new drug system
New feature: new drug system[message #303950] Thu, 26 April 2012 23:23 Go to previous message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
<font size="">New drug system</font>

I made an overhaul to the drug system. You can now select several drug components and build your own drugs from them.

First, a look at the new Drugs.xml. A drug component has the following tags:

...
<DRUG>
    <ubType>1</ubType>
    <ubDrugTravelRate>4</ubDrugTravelRate>
    <ubDrugWearoffRate>2</ubDrugWearoffRate>
    <ubDrugEffect>15</ubDrugEffect>
    <ubDrugSideEffect>20</ubDrugSideEffect>
    <ubDrugSideEffectRate>2</ubDrugSideEffectRate>
    <ubMoralBacklash>1</ubMoralBacklash>
</DRUG>
...


Now, what do these tags mean?

<ubType> is the number of the component, the specific effects are hardcoded (couldn't externalise those, or I'd need A LOT more tags).
<ubDrugTravelRate> determines how fast the drug comes to its full effect.
<ubDrugWearoffRate> determines how fast the drug effect will wear out.
<ubDrugEffect> measures the effect a drug has. As long as this value is > 0 the drug will have its main effect.
<ubDrugSideEffect> measures the drugs sideeffect. This starts once <ubDrugEffect> hits 0. This starts the second effect, which is mostly negative.
<ubDrugSideEffectRate> determines how fast the sideeffect will wear out.
<ubMoralBacklash> determines if there will be a morale drop once the <ubDrugEffect> hits 0.

So, in the above example, we have a drug that will have its ubDrugEffect raised by 4 every turn, until it hits 15. Then, every turn that value is lowered by 2. Once the ubDrugEffect is below 0, we lose a bit of morale, and the side effect starts at 20. This is again lowered by 2 every turn.

Due to coding restrictions, do not enter values above 126, or weird stuff will happen.

How do you make an item a drug? Simple, just look at these tags:

<usItemClass>268435456</usItemClass>     // always set this
<Medical>1</Medical>                     // always set this
<DrugType>30824</DrugType>


The only new tag is <DrugType>. This is a flag mask that determines the different components used. For a clearer example, just look at the new drugs I made in Items.xml (entries 1535 - 1538).

What drug components exist, and what do they do? Here is the answer:

#define DRUG_ADRENALINE		//0x00000001	//1        vanilla adrenaline
#define DRUG_ALCOHOL		//0x00000002	//2        vanilla alcohol
#define DRUG_REGENERATION	//0x00000004	//4        vanilla health regeneration
#define DRUG_DAMAGERESISTANCE	//0x00000008	//8        damage resistance of up to 25%/-20%
#define DRUG_STRENGTH		//0x00000010	//16       increases strength up to 25 points, lowers it by up to 10 as a side effect
#define DRUG_AGILITY		//0x00000020	//32       increases agility up to 25 points, lowers it by up to 10 as a side effect
#define DRUG_DEXTERITY   	//0x00000040	//64       increases dexterity up to 25 points, lowers it by up to 10 as a side effect
#define DRUG_WISDOM   		//0x00000080	//128      increases wisdom up to 25 points, lowers it by up to 10 as a side effect
#define DRUG_PERCEPTION		//0x00000100	//256      +/- 1 level during interrupts
#define DRUG_PSYCHO		//0x00000200	//512      merc gets the 'psycho' disability while drug/side effect lasts
#define DRUG_NERVOUS		//0x00000400	//1024     merc gets the 'nervous' disability while drug/side effect lasts
#define DRUG_CLAUSTROPHOBIC	//0x00000800	//2048     merc gets the 'claustrophobic' disability while drug/side effect lasts
#define DRUG_HEATINTOLERANT	//0x00001000	//4096     merc gets the 'heat intolerant' disability while drug/side effect lasts
#define DRUG_FEAROFINSECTS	//0x00002000	//8192     merc gets the 'fear of insects' disability while drug/side effect lasts
#define DRUG_FORGETFUL		//0x00004000	//16384    merc gets the 'forgetful' disability while drug/side effect lasts
#define DRUG_BLIND 		//0x00008000	//32768    merc goes blind for 2 turns once side effect hits 1
#define DRUG_KNOCKOUT 		//0x00010000	//65536    heart attack once side effect hits 1 (lose all breath and fall down)
#define DRUG_VISION 	        //0x00020000	//131072   increases sight range 10% on drug effect, decreases it 10% as a side effect
#define DRUG_TUNNELVISION 	//0x00040000	//262144   increases tunnelvison, side effect only


I made 4 new drugs to test this out. For example, the new drug 'Occulin' has a <DrugType>425984</DrugType>. This gives it the effects of DRUG_BLIND, DRUG_VISION and DRUG_TUNNELVISION. I've set the effects so that

  • once you take the drug, your sight range increases 10%
  • once the side effect starts, your sight range is lowered 10% nad you get up to 25% tunnelvison
  • Once that is over, you are blinded for 2 turns


Purely for demonstration reasons, I equipped the most dutch merc I could find with a wide array of, ehm, medical supplies:

http://i50.tinypic.com/2m6ph6w.jpg
This is her normal vision...
http://i50.tinypic.com/2nqy1qx.jpg
... she just took the drug, her vision is enhanced.
http://i50.tinypic.com/148qbm9.jpg
The side effect kicked in.
http://i47.tinypic.com/2605orc.jpg
Now she doesn't see anything (note the icon on her portrait).
http://i48.tinypic.com/6zlbhw.jpg
Drugged dutch girls go berserker. APs on drugs are now shown in pink, the old blue-on black wasn't very readable.

Buns has all drugs in her Kit 5 for demonstration purposes. They are not available on BRs, but perhaps Arulco's drug dealers might have some?

Other drugs I made have the effect of raising strength, but having the risk of a heart attack, as well as your merc becoming a psychopath. But you can think of drugs of your own, become an alchemist with the <DrugType>-tag.

I'll send this to RoWa.

Happy Alchemy!

[Updated on: Wed, 17 June 2015 21:37]

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New Feature: Dynamic opinions
Next Topic: New Feature: militia volunteer pool
Goto Forum:
  


Current Time: Thu Mar 28 10:52:14 GMT+2 2024

Total time taken to generate the page: 0.02597 seconds