DotP 2014: ObjectDC Functions

From RSN Magic
Revision as of 08:42, 10 July 2013 by RiiakShiNal (Talk | contribs) (Items Included)

Jump to: navigation, search

This mod is aimed at creating an Object Data Chest that can be used simply since DotP 2014 removed the ObjectDataChest that we had been using in DotP 2013 for some cards/functions.

Installation

Just drop the wad into the DotP 2014 game directory and you're done.

Items Included

Constants - RSN_OBJECTDC.LOL

  • RSN_REGISTER_OBJECTDC_CHEST = 8192000
  • RSN_REGISTER_OBJECTDC_CHEST_COUNT = 0

Functions - RSN_OBJECTDC.LOL

RSN_ClearObjectDC

This function hopefully won't be necessary since I use Set_CardPtr, though if for whatever reason the pointer doesn't get set to null on zone change this can be used to clear it.

Parameters:

  • oCard - The Card Object to look for and clear the Object Data Chest for.

Usage Example:

RSN_ClearObjectDC( TriggerObject() )

RSN_GetObjectDC

This function does the real checking and allows for other cards to look at a card's ObjectDC. LUA will set any missing parameters to nil and due to the way I coded the function the second parameter only matters if it is true, so for false it can be treated as optional.

Parameters:

  • oCard - The Card Object to get the Object Data Chest for.
  • bCreate - Whether to create an Object Data Chest if one is not found.

Usage Examples:

local oDC = RSN_GetObjectDC( TriggerObject() )
if (oDC ~= nil) then
  -- Check Something
  local nItemCount = oDC:Int_Get( 355 )
end
local oDC = RSN_GetObjectDC( TriggerObject(), false )
if (oDC ~= nil) then
  -- Check Something
  local nItemCount = oDC:Int_Get( 355 )
end
local oDC = RSN_GetObjectDC( FilteredCard(), true )
oDC:Int_Set( 355, 1 )
oDC:Set_CardPtr( 356, EffectSource() )

RSN_ObjectDC

This function is meant to be an analogue for DotP 2013's ObjectDC() function. It returns the Object Data Chest for the current object (creating one if it doesn't exist).

Parameters: None

Usage Example:

local oDC = RSN_ObjectDC()
oDC:Int_Inc( 0 )

Download

File:Data DLC 8192 ObjectDC.wad