AndroidQuazar / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
36 stars 18 forks source link

New shield code #4

Closed Taranchuk closed 4 years ago

Taranchuk commented 4 years ago

New changes:

Shields are now counted as apparel instead of equipment. This is done so that we can draw them in the apparel class, instead of in the pavn renderer transpiler. If possible, additional patches can be made to virtually place them in the equipment section.

Removed stats worker patch. As it turned out, it does not affect armor stats at all, it handles in a separate patch. Still not fully understood the purpose of this patch, but the combat is still unchanged after the removal of this stats worker patch.

There are changes in the medieval mod, we need to put this xml block:

        <thingClass>VFECore.Apparel_Shield</thingClass>
        <apparel>
            <bodyPartGroups>
                <li>LeftHand</li>
            </bodyPartGroups>
            <layers>
                <li>VFEC_OuterShell</li>
            </layers>
        </apparel>

into <ThingDef Name="VFEM_BaseShield"

Taranchuk commented 4 years ago

Otherwise everything is unchanged, no functionality has been removed or altered

lbmaian commented 4 years ago

Removed stats worker patch. As it turned out, it does not affect armor stats at all, it handles in a separate patch. Still not fully understood the purpose of this patch, but the combat is still unchanged after the removal of this stats worker patch.

@Taranchuk It's for adding stat modifiers for non-shield/armor-related stats like a move speed modifier, e.g.

        <equippedStatOffsets>
            <ShootingAccuracyPawn>-0.1</ShootingAccuracyPawn>
            <MoveSpeed>-0.5</MoveSpeed>
        </equippedStatOffsets>

With your change to make shields part of apparel, this isn't needed anymore, since stat modifiers from worn apparel are automatically considered in StatsWorker. The patch was only necessary for equipment because StatsWorker only looked at the primary equipment.

I've also considered making a similar change in JecsTools (making shields apparel and/or removing StatsWorker patch), which shares ChJeez Pawn Shields heritage with this mod, for performance reasons, but thought it would be too much of a breaking change for a legacy framework, especially since some JecsTools shields are also weapons. (As a low priority, I've thinking up some performance workarounds.)