Multi Verb Combat Framework - AndroidQuazar/VanillaExpandedFramework GitHub Wiki
Multi Verb Combat Framework (MVCF) enables pawns to use ranged attacks provided by hediffs, apparel, and their race. In addition, it provides many unique features for additional flexibility in defining your attacks.
The first thing you have to do to use MVCF is create a MVCF mod definition. In some def file in your mod, add a MVCF.ModDef
, and enter a defName
, label
, and description
. defName
must be unique to your mod, and the other two do not matter, they just must not be empty. None of these fields will ever be shown to the player. Next, add a Features
tag, which will be filled as you develop. Whenever this documentation mentions "You must enable the SomeFeatureHere
feature in your ModDef
", it means you need to add a SomeFeatureHere
tag to this Features
area and set it to true. For example, here's a mod def enabling the RangedAnimals
, HediffVerbs
, and IntegratedToggle
features: (Credit to Sarg)
<MVCF.ModDef>
<defName>MM_MagicalMenagerie</defName>
<label>Magical Menagerie</label>
<description>Adding animal ranged attacks for Magical Menagerie creatures</description>
<Features>
<RangedAnimals>true</RangedAnimals>
<HediffVerbs>true</HediffVerbs>
<IntegratedToggle>true</IntegratedToggle>
</Features>
</MVCF.ModDef>
How you go about adding the verbs depends on what you want to add them to.
With Apparel, put the verbs in the verbs
field of the ThingDef
, then add MVCF.Comps.CompProperties_VerbGiver
to its comps
. This requires enabling the feature ApparelVerbs
in your ModDef
.
Now, HediffDef
doesn't have a verbs
field, so you need to put the verbs in the comp itself. Add a HediffCompProperties_VerbGiver
to the comps
and then put your verbs in the verbs
field of it. This requires enabling the feature HediffVerbs
in your ModDef
. If these hediffs may be applied to an animal, you also need to enable the RangedAnimals
and IntegratedToggle
features.
Another thing MVCF allows is a weapon that has more than one ranged attacks. To use this feature, simply add more verbs to the verbs
field or your weapon's ThingDef
. This requires enabling the feature ExtraEquipmentVerbs
in your ModDef
.
To have a pawn's race give them a ranged attack, simple add a verbs
field to the pawn's race's ThingDef
. If you are adding these to an animal, you need to enable the RangedAnimals
and IntegratedToggle
features.
Want to customize your verbs even more? You need to provide AdditionalVerbProps
. How you do this depends on how you provided the verbs. All the verbProps
fields here are lists of the class AdditionalVerbProps
.
Simply add a verbProps
field to your VerbGiver
comp.
Switch HediffCompProperties_VerbGiver
to MVCF.Comps.HediffCompProperties_ExtendedVerbGiver
and add a verbProps
field.
Switch the li
in comps
with compClass
of CompEquippable
to have a Class
of MVCF.Comps.CompProperties_VerbProps
, then add a verbProps
field. Or, you can give them a new comp of type Comp_VerbProps
, with properties of MVCF.Comps.CompProperties_VerbProps
.
One unique feature of MVCF is the ability to give ranged attacks to melee weapons, and have them still considered melee. This is useful if you want extra abilities on your spear or axe or whatever. To do this, provide <ConsiderMelee>true</ConsiderMelee>
as a sibling node to the verbProps
for your weapon.
Verbs on animals with no props will always be togglable. That being said, you can provide them with some by giving the pawn a Comp_VerbProps
.