コード例 #1
0
ファイル: EffectPlugin.cs プロジェクト: nwn-dotnet/NWN.Core
        /// Convert unpacked effect structure to native type.
        /// <param name="e">The NWNX_EffectUnpacked structure to convert.</param>
        /// <returns>The effect.</returns>
        public static System.IntPtr PackEffect(NWNX_EffectUnpacked e)
        {
            const string sFunc = "PackEffect";

            VM.NWNX.SetFunction(NWNX_Effect, sFunc);
            __NWNX_Effect_ResolvePack(sFunc, e);
            VM.NWNX.Call();
            return(VM.NWNX.StackPopStruct(ENGINE_STRUCTURE_EFFECT));
        }
コード例 #2
0
ファイル: EffectPlugin.cs プロジェクト: nwn-dotnet/NWN.Core
        /// Replaces an already applied effect with another.
        /// <param name="oObject">The object with the effect to replace</param>
        /// <param name="nIndex">The array element to be replaced</param>
        /// <param name="e">The unpacked effect to replace it with.</param>
        /// @note Cannot replace an effect with a different type or ID.
        public static void ReplaceEffectByIndex(uint oObject, int nIndex, NWNX_EffectUnpacked e)
        {
            const string sFunc = "ReplaceEffectByIndex";

            VM.NWNX.SetFunction(NWNX_Effect, sFunc);
            __NWNX_Effect_ResolvePack(sFunc, e, TRUE);
            VM.NWNX.StackPush(nIndex);
            VM.NWNX.StackPush(oObject);
            VM.NWNX.Call();
        }
コード例 #3
0
ファイル: EffectPlugin.cs プロジェクト: nwn-dotnet/NWN.Core
 public static void __NWNX_Effect_ResolvePack(string sFunc, NWNX_EffectUnpacked e, int bReplace = FALSE)
 {
     if (bReplace == FALSE)
     {
         VM.NWNX.StackPush(e.nType);
     }
     VM.NWNX.StackPush(e.nSubType);
     VM.NWNX.StackPush(e.fDuration);
     VM.NWNX.StackPush(e.nExpiryCalendarDay);
     VM.NWNX.StackPush(e.nExpiryTimeOfDay);
     VM.NWNX.StackPush(e.oCreator);
     VM.NWNX.StackPush(e.nSpellId);
     VM.NWNX.StackPush(e.bExpose);
     VM.NWNX.StackPush(e.bShowIcon);
     VM.NWNX.StackPush(e.nCasterLevel);
     if (bReplace == FALSE)
     {
         VM.NWNX.StackPush(e.eLinkLeft, ENGINE_STRUCTURE_EFFECT);
         VM.NWNX.StackPush(e.bLinkLeftValid);
         VM.NWNX.StackPush(e.eLinkRight, ENGINE_STRUCTURE_EFFECT);
         VM.NWNX.StackPush(e.bLinkRightValid);
     }
     VM.NWNX.StackPush(e.nNumIntegers);
     VM.NWNX.StackPush(e.nParam0);
     VM.NWNX.StackPush(e.nParam1);
     VM.NWNX.StackPush(e.nParam2);
     VM.NWNX.StackPush(e.nParam3);
     VM.NWNX.StackPush(e.nParam4);
     VM.NWNX.StackPush(e.nParam5);
     VM.NWNX.StackPush(e.nParam6);
     VM.NWNX.StackPush(e.nParam7);
     VM.NWNX.StackPush(e.fParam0);
     VM.NWNX.StackPush(e.fParam1);
     VM.NWNX.StackPush(e.fParam2);
     VM.NWNX.StackPush(e.fParam3);
     VM.NWNX.StackPush(e.sParam0);
     VM.NWNX.StackPush(e.sParam1);
     VM.NWNX.StackPush(e.sParam2);
     VM.NWNX.StackPush(e.sParam3);
     VM.NWNX.StackPush(e.sParam4);
     VM.NWNX.StackPush(e.sParam5);
     VM.NWNX.StackPush(e.oParam0);
     VM.NWNX.StackPush(e.oParam1);
     VM.NWNX.StackPush(e.oParam2);
     VM.NWNX.StackPush(e.oParam3);
     VM.NWNX.StackPush(e.vParam0.X);
     VM.NWNX.StackPush(e.vParam0.Y);
     VM.NWNX.StackPush(e.vParam0.Z);
     VM.NWNX.StackPush(e.vParam1.X);
     VM.NWNX.StackPush(e.vParam1.Y);
     VM.NWNX.StackPush(e.vParam1.Z);
     VM.NWNX.StackPush(e.sTag);
     VM.NWNX.StackPush(e.sItemProp);
 }
コード例 #4
0
ファイル: EffectPlugin.cs プロジェクト: nwn-dotnet/NWN.Core
        // @}
        public static NWNX_EffectUnpacked __NWNX_Effect_ResolveUnpack(string sFunc, int bLink = TRUE)
        {
            NWNX_EffectUnpacked n = default;

            n.sItemProp = VM.NWNX.StackPopString();
            n.sTag      = VM.NWNX.StackPopString();
            float fZ = VM.NWNX.StackPopFloat();
            float fY = VM.NWNX.StackPopFloat();
            float fX = VM.NWNX.StackPopFloat();

            n.vParam1      = new System.Numerics.Vector3(fX, fY, fZ);
            fZ             = VM.NWNX.StackPopFloat();
            fY             = VM.NWNX.StackPopFloat();
            fX             = VM.NWNX.StackPopFloat();
            n.vParam0      = new System.Numerics.Vector3(fX, fY, fZ);
            n.oParam3      = VM.NWNX.StackPopObject();
            n.oParam2      = VM.NWNX.StackPopObject();
            n.oParam1      = VM.NWNX.StackPopObject();
            n.oParam0      = VM.NWNX.StackPopObject();
            n.sParam5      = VM.NWNX.StackPopString();
            n.sParam4      = VM.NWNX.StackPopString();
            n.sParam3      = VM.NWNX.StackPopString();
            n.sParam2      = VM.NWNX.StackPopString();
            n.sParam1      = VM.NWNX.StackPopString();
            n.sParam0      = VM.NWNX.StackPopString();
            n.fParam3      = VM.NWNX.StackPopFloat();
            n.fParam2      = VM.NWNX.StackPopFloat();
            n.fParam1      = VM.NWNX.StackPopFloat();
            n.fParam0      = VM.NWNX.StackPopFloat();
            n.nParam7      = VM.NWNX.StackPopInt();
            n.nParam6      = VM.NWNX.StackPopInt();
            n.nParam5      = VM.NWNX.StackPopInt();
            n.nParam4      = VM.NWNX.StackPopInt();
            n.nParam3      = VM.NWNX.StackPopInt();
            n.nParam2      = VM.NWNX.StackPopInt();
            n.nParam1      = VM.NWNX.StackPopInt();
            n.nParam0      = VM.NWNX.StackPopInt();
            n.nNumIntegers = VM.NWNX.StackPopInt();
            if (bLink == TRUE)
            {
                n.bLinkRightValid = VM.NWNX.StackPopInt();
                n.eLinkRight      = VM.NWNX.StackPopStruct(ENGINE_STRUCTURE_EFFECT);
                n.bLinkLeftValid  = VM.NWNX.StackPopInt();
                n.eLinkLeft       = VM.NWNX.StackPopStruct(ENGINE_STRUCTURE_EFFECT);
            }
            else
            {
                n.bLinkRightValid = FALSE;
                n.bLinkLeftValid  = FALSE;
            }
            n.nCasterLevel       = VM.NWNX.StackPopInt();
            n.bShowIcon          = VM.NWNX.StackPopInt();
            n.bExpose            = VM.NWNX.StackPopInt();
            n.nSpellId           = VM.NWNX.StackPopInt();
            n.oCreator           = VM.NWNX.StackPopObject();
            n.nExpiryTimeOfDay   = VM.NWNX.StackPopInt();
            n.nExpiryCalendarDay = VM.NWNX.StackPopInt();
            n.fDuration          = VM.NWNX.StackPopFloat();
            n.nSubType           = VM.NWNX.StackPopInt();
            n.nType = VM.NWNX.StackPopInt();
            n.sID   = VM.NWNX.StackPopString();
            return(n);
        }