Weight Pendant

From SkyCorp Global
Jump to: navigation, search
Note - these clothes are a modification for The Underworld. Visit the new Mods Portal for more mods, mods on the wiki are no longer maintained. You can put it in-game by visiting the Debug Mod Control Panel in the debug rooms and browse to this mod or copy/paste the JSON below into the program window.

Entity Details

This pendant will increase the player's weight as they wear it. It is a cursed pendant, and must be purified in order to be removed (for example, by Arya at the Haven Temple.

Author: SkyCorp

Entity JSON Code

{
	"type": "CLOTHING",
	"name":
	{
		"literalString": "Weight Pendant"
	},
	"description":
	{
		"literalString": "A surprisingly heavy pendant on an ornate chain."
	},
	"getSlot":
	{
		"literalString": "neck"
	},
	"playerAttemptPickupCheck":
	{
		"programBoolean": true
	},
	"playerAttemptDropCheck":
	{
		"programBoolean": true
	},
	"inInventoryTick":
	{
		"programVoid": true
	},
	"luac": "G0x1YVEAAQQEBAgAEwAAAEB3ZWlnaHRQZW5kYW50Lmx1YQAAAAAAAAAAAAAAAgIKAAAAJAAAAAcAAAAkQAAAB0AAACSAAAAHgAAABcAAAAYAQQAcQIAAHgCAAAUAAAAEGQAAAHBsYXllckF0dGVtcHRQaWNrdXBDaGVjawAEFwAAAHBsYXllckF0dGVtcHREcm9wQ2hlY2sABBAAAABpbkludmVudG9yeVRpY2sABAUAAAB0aGlzAAQLAAAAbWFrZUN1cnNlZAADAAAAAAAAAAIAAAAMAAAAAAAABBUAAAAFAAAABkBAAEGAAACFwAAAhgBBAZyAgADBQAEAVcCAABxAAAEFwAAABoBBAByAgAAaAAAAFsAAgAUAAAAGQEAAQcABABxAAAECAIAAHgAAAR4AgAAIAAAABAMAAABpbwAEBgAAAHdyaXRlAAQaAAAAWW91IHBpY2sgdXAgYW5kIHdlYXIgdGhlIAAEBQAAAHRoaXMABAgAAABnZXROYW1lAAQEAAAALiAgAAQKAAAAZ2V0Q3Vyc2VkAAQ5AAAAVGhlIGNoYWluIHNlZW1zIHRvIHRpZ2h0ZW4gYXJvdW5kIHlvdXIgbmVjayBieSBpdHNlbGYuCgoAAAAAABUAA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MAAABpbwAEBgAAAHdyaXRlAAQvAAAAWW91IGZlZWwgdGhlIHBlbmRhbnQgZ3JvdyB3YXJtIG9uIHlvdXIgbmVjay4gIAAEBwAAAFBsYXllcgAEDAAAAGdldEluc3RhbmNlAAQOAAAAaW5jT3ZlcndlaWdodAADAAAAAAAAFEAAAAAAEgAAACkAAAApAAAAKQAAACkAAAApAAAAKQAAACkAAAArAAAAKwAAACsAAAArAAAALgAAAC4AAAAuAAAALgAAAC4AAAAuAAAAMAAAAAAAAAAAAAAACgAAAAwAAAACAAAAJAAAAA8AAAAwAAAAJwAAADQAAAA0AAAANAAAADQAAAAAAAAAAAAAAA=="	
}

LUA Source Code

-- Called when player wants to pick up/wear pendant.
function playerAttemptPickupCheck()

   io.write("You pick up and wear the " .. this.getName() .. ".  ");

   if this.getCursed() then
      io.write("The chain seems to tighten around your neck by itself.\n\n");
   end

   -- Always okay to pick up / wear this item.
   return true;
end

-- Called when player wants to drop pendant.
function playerAttemptDropCheck()
   if this.getCursed() then
      -- Disallow player from droping cursed item
      MainScreen.addGameText(GameText.parseText("You try to take off the " ..
         "pendant with your [[HANDS DESCRIPTION]], but it won't budge... " ..
         "it's cursed!\n\n"));

      -- MainScreen.addGameText is used here instead of io.write.  This is
      -- because of a LUFA bug, GameText.parseText appears to be returning 
      -- multiple erroneous extra strings from GameText.parseText, even though 
      -- AS3 is not doing so.  Thus MainScreen.addGameText is used (probably
      -- a good idea to use in general unless you specifically want to output
      -- an array).

      return false;
   else
      -- Not cursed, allow drop
      MainScreen.addGameText(GameText.parseText("You take off the pendant " ..
         "with your [[HANDS DESCRIPTION]] and drop it to the ground.\n\n"));
      return true;
   end
end

-- Called every game tick while player is carrying / wearing pendant.
function inInventoryTick()
   -- Random 50% chance of the pendant transforming player.
   if math.random(1,2) == 2 then
      -- Player will be TF'ed.
      io.write("You feel the pendant grow warm on your neck.  ");

      -- Make player 5% fatter.
      Player.getInstance().incOverweight(5);
   end
end

-- As this is not contained in a function, it will be executed immediately
-- during mod load.
this.makeCursed();