initial commit
This commit is contained in:
parent
f2dd81e5d1
commit
8651df0118
@ -154,7 +154,7 @@
|
|||||||
"ChaosBagStatTracker.766620",
|
"ChaosBagStatTracker.766620",
|
||||||
"Blesstokens.afa06b",
|
"Blesstokens.afa06b",
|
||||||
"Cursetokens.bd0253",
|
"Cursetokens.bd0253",
|
||||||
"WhimsicalsTokenRemover.0a5a29",
|
"TokenRemover.0a5a29",
|
||||||
"TokenSpawner.36b4ee",
|
"TokenSpawner.36b4ee",
|
||||||
"Fan-MadeScenariosCampaignsMiscellany.66e97c",
|
"Fan-MadeScenariosCampaignsMiscellany.66e97c",
|
||||||
"OfficialStandaloneChallengeScenarios.0ef5c8",
|
"OfficialStandaloneChallengeScenarios.0ef5c8",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"10": {
|
"10": {
|
||||||
"body": "Created by Whimsical\n\nAnything that passes over the remover that isn't a card or a deck will be deleted.\r\nTo use the remover, right click on it, choose the \"Enable\" option, and take your card with resources/horror/damage and swipe it over the remover. You may wish to unlock and/or copy the remover to your play area first.",
|
"body": "Created by Whimsical\n\nAnything that passes over the remover that isn't a card, deck or chaos token will be deleted.\r\nTo use the remover, right click on it, choose the \"Enable\" option, and take your card with resources/horror/damage and swipe it over the remover. You may wish to unlock and/or copy the remover to your play area first.",
|
||||||
"color": "Grey",
|
"color": "Grey",
|
||||||
"id": 10,
|
"id": 10,
|
||||||
"title": "Token Remover",
|
"title": "Token Remover",
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"CustomTile": {
|
"CustomTile": {
|
||||||
"Stackable": false,
|
"Stackable": false,
|
||||||
"Stretch": true,
|
"Stretch": true,
|
||||||
"Thickness": 0.2,
|
"Thickness": 0.1,
|
||||||
"Type": 0
|
"Type": 0
|
||||||
},
|
},
|
||||||
"ImageScalar": 1,
|
"ImageScalar": 1,
|
||||||
@ -34,10 +34,10 @@
|
|||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": false,
|
"Locked": false,
|
||||||
"LuaScript": "require(\"util/TokenRemover\")",
|
"LuaScript": "require(\"util/TokenRemover\")",
|
||||||
"LuaScriptState": "[]",
|
"LuaScriptState": "",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "Custom_Tile",
|
"Name": "Custom_Tile",
|
||||||
"Nickname": "Whimsical's Token Remover",
|
"Nickname": "Token Remover",
|
||||||
"Snap": true,
|
"Snap": true,
|
||||||
"Sticky": true,
|
"Sticky": true,
|
||||||
"Tags": [
|
"Tags": [
|
||||||
@ -45,16 +45,16 @@
|
|||||||
],
|
],
|
||||||
"Tooltip": true,
|
"Tooltip": true,
|
||||||
"Transform": {
|
"Transform": {
|
||||||
"posX": -6.868,
|
"posX": -7,
|
||||||
"posY": 1.583,
|
"posY": 1.583,
|
||||||
"posZ": -16.394,
|
"posZ": -16.4,
|
||||||
"rotX": 0,
|
"rotX": 0,
|
||||||
"rotY": 90,
|
"rotY": 90,
|
||||||
"rotZ": 0,
|
"rotZ": 0,
|
||||||
"scaleX": 0.75,
|
"scaleX": 0.8,
|
||||||
"scaleY": 1,
|
"scaleY": 1,
|
||||||
"scaleZ": 0.75
|
"scaleZ": 0.8
|
||||||
},
|
},
|
||||||
"Value": 0,
|
"Value": 0,
|
||||||
"XmlUI": ""
|
"XmlUI": ""
|
||||||
}
|
}
|
@ -1,72 +1,80 @@
|
|||||||
---
|
|
||||||
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
||||||
--- Created by Whimsical.
|
|
||||||
--- DateTime: 2021-02-02 9:41 a.m.
|
|
||||||
---
|
|
||||||
|
|
||||||
local zone = nil
|
local zone = nil
|
||||||
|
local CHAOS_TOKEN_NAMES = {
|
||||||
|
"Elder Sign",
|
||||||
|
"+1",
|
||||||
|
"0",
|
||||||
|
"-1",
|
||||||
|
"-2",
|
||||||
|
"-3",
|
||||||
|
"-4",
|
||||||
|
"-5",
|
||||||
|
"-6",
|
||||||
|
"-7",
|
||||||
|
"-8",
|
||||||
|
"Skull",
|
||||||
|
"Cultist",
|
||||||
|
"Tablet",
|
||||||
|
"Elder Thing",
|
||||||
|
"Auto-fail",
|
||||||
|
"Bless",
|
||||||
|
"Curse",
|
||||||
|
"Frost"
|
||||||
|
}
|
||||||
|
|
||||||
-- Forward Declaration
|
-- general code
|
||||||
---@param is_enabled boolean
|
|
||||||
local setMenu = function(is_enabled) end
|
|
||||||
|
|
||||||
local function enable()
|
|
||||||
if self.held_by_color~=nil then return end
|
|
||||||
local position = self:getPosition()
|
|
||||||
local rotation = self:getRotation()
|
|
||||||
local scale = self:getScale()
|
|
||||||
|
|
||||||
zone = spawnObject {
|
|
||||||
type = "ScriptingTrigger",
|
|
||||||
position = Vector(position.x, position.y+25+(bit32.rshift(scale.y, 1))+0.41, position.z),
|
|
||||||
rotation = rotation,
|
|
||||||
scale = Vector(scale.x*2, 50, scale.z*2),
|
|
||||||
sound = true,
|
|
||||||
snap_to_grid = true
|
|
||||||
}
|
|
||||||
|
|
||||||
setMenu(false)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function disable()
|
|
||||||
if zone~=nil then zone:destruct() end
|
|
||||||
setMenu(true)
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param is_enabled boolean
|
|
||||||
setMenu = function(is_enabled)
|
|
||||||
self:clearContextMenu()
|
|
||||||
if is_enabled then
|
|
||||||
self:addContextMenuItem("Enable", enable, false)
|
|
||||||
else
|
|
||||||
self:addContextMenuItem("Disable", disable, false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function onLoad(save_state)
|
|
||||||
if save_state=="" then return end
|
|
||||||
local data = JSON.decode(save_state)
|
|
||||||
zone = getObjectFromGUID(data.zone)
|
|
||||||
setMenu(zone==nil)
|
|
||||||
end
|
|
||||||
|
|
||||||
function onSave()
|
function onSave()
|
||||||
return JSON.encode {
|
return JSON.encode(zone and zone.getGUID() or nil)
|
||||||
zone = zone and zone:getGUID() or nil
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param entering TTSObject
|
function onLoad(savedData)
|
||||||
---@param object TTSObject
|
if savedData ~= "" and savedData ~= nil then
|
||||||
function onObjectEnterScriptingZone(entering , object)
|
zone = getObjectFromGUID(JSON.decode(savedData))
|
||||||
if zone~=entering then return end
|
end
|
||||||
if object==self then return end
|
setMenu(zone == nil)
|
||||||
if object.type=="Deck" or object.type=="Card" then return end
|
|
||||||
|
|
||||||
object:destruct()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param color string
|
-- context menu functions
|
||||||
function onPickUp(color)
|
function enable()
|
||||||
disable()
|
local scale = self.getScale()
|
||||||
|
|
||||||
|
zone = spawnObject({
|
||||||
|
type = "ScriptingTrigger",
|
||||||
|
position = self.getPosition() + Vector(0, 2.5 + 0.11, 0),
|
||||||
|
rotation = self.getRotation(),
|
||||||
|
scale = { scale.x * 2, 5, scale.z * 2 }
|
||||||
|
})
|
||||||
|
|
||||||
|
setMenu(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
function disable()
|
||||||
|
if zone ~= nil then zone.destruct() end
|
||||||
|
setMenu(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- core functions
|
||||||
|
function setMenu(isEnabled)
|
||||||
|
self.clearContextMenu()
|
||||||
|
if isEnabled then
|
||||||
|
self.addContextMenuItem("Enable", enable)
|
||||||
|
else
|
||||||
|
self.addContextMenuItem("Disable", disable)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onObjectEnterScriptingZone(entering, object)
|
||||||
|
if zone ~= entering or object == self or object.type == "Deck" or object.type == "Card" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local name = object.getName()
|
||||||
|
for _, entry in ipairs(CHAOS_TOKEN_NAMES) do
|
||||||
|
if entry == name then return end
|
||||||
|
end
|
||||||
|
|
||||||
|
object.destruct()
|
||||||
|
end
|
||||||
|
|
||||||
|
function onPickUp()
|
||||||
|
disable()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user