This commit is contained in:
2023-08-19 19:21:17 +08:00
parent 36dfa79e0d
commit 76b7abf06b
111 changed files with 12062 additions and 867 deletions

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<Atlas><Texture filename="modicon.tex" />
<Elements><Element name="modicon.tex" u1="0" u2="1" v1="0" v2="1" />
</Elements></Atlas>

View File

@@ -0,0 +1,64 @@
name = 'Your skeleton respawn'
description = "Resurrection from your skeleton! Allows you to resurrect yourself on your skeleton. ----------UPDATED---------- + Added the ability to configure health penalty --------------------------------"
author = 'BEKKITT'
version = '1.2.6.2'
dont_starve_compatible = true
dst_compatible = true
reign_of_giants_compatible = true
client_only_mod = false
all_clients_require_mod = false
forumthread = ''
api_version = 10
server_filter_tags = {'bekkitt', 'resurrection', 'skeleton',}
icon_atlas = 'modicon.xml'
icon = 'modicon.tex'
configuration_options =
{
{
name = 'skeleton_player',
label = '',
default = true,
options = {
{description = '', data = true},
},
},
{
name = 'bekkitt_skeleton_pen',
label = 'Blood sacrifice',
default = 0,
options = {
{description = '0%',data = 0, hover = "No health pentalty"},
{description = '5%', data = 0.05, hover = "5% health pentalty"},
{description = '10%', data = 0.1, hover = "10% health pentalty"},
{description = '25%', data = 0.25, hover = "Default in DST 25% health pentalty"},
{description = '30%', data = 0.3, hover = "30% health pentalty"},
{description = '40%', data = 0.4, hover = "40% health pentalty"},
{description = '50%', data = 0.5, hover = "50% health pentalty"},
{description = '60%', data = 0.6, hover = "60% health pentalty"},
{description = '70%', data = 0.7, hover = "70% health pentalty"},
{description = '75%', data = 0.75, hover = "75% Max in DST health pentalty"},
},
},
{
name = 'null_option',
label = '',
default = true,
options = {
{description = '', data = true},
},
},
}

View File

@@ -0,0 +1,89 @@
local bekkitt_prefabs = {
'skeleton_player',
}
function apply_negative_effects(inst)
if inst.LastResSource and inst.LastResSource:HasTag('bekkitt_skeleton_resp') then
new_penalty = inst.components.health.penalty + GetModConfigData('bekkitt_skeleton_pen')
if new_penalty >= .75 then
new_penalty = .75
end
inst.components.health.penalty = new_penalty
inst.components.health:ForceUpdateHUD(false)
end
end
function save_last_respawn_source(inst, data)
if data then
inst.LastResSource = data.source
end
end
AddPlayerPostInit(
function(inst)
inst:ListenForEvent('respawnfromghost', save_last_respawn_source)
inst:ListenForEvent('ms_respawnedfromghost', apply_negative_effects)
end
)
local light_fire_on_haunt = function(inst, haunter)
if ( inst.components.fueled ~= nil ) then
inst.components.fueled:DoDelta( TUNING.LARGE_FUEL )
end
return true
end
for i, prefab_name in ipairs( bekkitt_prefabs ) do
local allow_rez = GetModConfigData( prefab_name )
if ( allow_rez ) then
AddPrefabPostInit(
prefab_name,
function(inst)
if ( inst.components.hauntable ~= nil ) then
inst:RemoveComponent('hauntable')
end
inst:AddComponent('hauntable')
inst.components.hauntable:SetOnHauntFn( light_fire_on_haunt )
inst.components.hauntable:SetHauntValue(TUNING.HAUNT_INSTANT_REZ)
inst:AddTag('resurrector')
inst:AddTag('bekkitt_skeleton_resp')
end
)
end
end
local function SkeletonRemove(inst)
for k,ent in pairs(GLOBAL.Ents) do
if ent.prefab == "skeleton_player" and ent.playername == inst.name then
ent:Remove()
end
end
end
local function SkeletonRemoval(inst)
inst:ListenForEvent("death", SkeletonRemove)
end
AddPlayerPostInit(SkeletonRemoval)

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="modicon.tex" /><Elements><Element name="modicon.tex" u1="0.00390625" u2="0.99609375" v1="0.00390625" v2="0.99609375" /></Elements></Atlas>

View File

@@ -0,0 +1,94 @@
name = "Smart Minisign"
description = [[Can draw by itself
会自己画画的小木牌
v1.14 可以换皮肤(Support Skin)
v1.10 兼容盐箱(SaltBox)
v1.08 兼容mod物品 提供了一个API 允许其他mod调用]]
author = "小班花 mamjun1"
version = "1.1.5"
forumthread = ""
api_version = 10
priority = -99999
dst_compatible = true
dont_starve_compatible = false
reign_of_giants_compatible = false
all_clients_require_mod = true
icon_atlas = "modicon.xml"
icon = "modicon.tex"
configuration_options =
{
{
name = "Icebox",
label = "Icebox",
hover = "Minisign for icebox/允许冰箱添加小木牌",
options =
{
{description = "No(关闭)", data = false},
{description = "Yes(打开)", data = true},
},
default = false,
},
{
name = "ChangeSkin",
label = "ChangeSkin",
hover = "Minisign can change skin/允许小木牌切换皮肤",
options =
{
{description = "Yes(是)", data = true},
{description = "No(否)", data = false},
},
default = true,
},
{
name = "DragonflyChest",
label = "DragonflyChest",
hover = "Minisign for DragonflyChest/允许龙鳞箱子添加小木牌",
options =
{
{description = "No(关闭)", data = false},
{description = "Yes(打开)", data = true},
},
default = false,
},
{
name = "SaltBox",
label = "SaltBox",
hover = "Minisign for SaltBox/允许盐箱添加小木牌",
options =
{
{description = "No(关闭)", data = false},
{description = "Yes(打开)", data = true},
},
default = false,
},
{
name = "BundleItems",
label = "BundleItems",
hover = "Show the item in bundle/显示包裹里面的物品",
options =
{
{description = "No(关闭)", data = false},
{description = "Yes(打开)", data = true},
},
default = false,
},
{
name = "Digornot",
label = "CanbeDug",
hover = "Can be Dug/是否可以被挖",
options =
{
{description = "No(关闭)", data = false},
{description = "Yes(打开)", data = true},
},
default = false,
},
}

View File

@@ -0,0 +1,173 @@
--You have to learn to draw by yourself
Assets = {}
GLOBAL.TUNING.HUAMINISIGN_BUNDLE = GetModConfigData("BundleItems")
GLOBAL.TUNING.HUAMINISIGN_DIG = GetModConfigData("Digornot")
GLOBAL.TUNING.HUAMINISIGN_SKIN = GetModConfigData("ChangeSkin")
---inventoryitem
local inventoryItemAtlasLookup = {}
local function GetAtlas(imagename)
local atlas = inventoryItemAtlasLookup[imagename]
if atlas then
return atlas
end
local base_atlas = "images/inventoryimages1.xml"
atlas = GLOBAL.TheSim:AtlasContains(base_atlas, imagename) and base_atlas or "images/inventoryimages2.xml"
inventoryItemAtlasLookup[imagename] = atlas
return atlas
end
AddClassPostConstruct( "components/inventoryitem_replica", function(self, inst)
local old_SetAtlas = self.SetAtlas
function self:SetAtlas(atlasname)
if old_SetAtlas ~= nil then
old_SetAtlas(self,atlasname)
end
self._huastrings = atlasname ~= nil and GLOBAL.resolvefilepath(atlasname) or ""
end
function self:GetHuaAtlas()
return self._huastrings ~= nil and
self._huastrings ~= "" and
self._huastrings or
self:GetAtlas()
end
end)
----================为了删掉上个旧版本写错的木牌===
local function onloadpostpass(inst, newents, savedata)
if savedata ~= nil then
if savedata.huachest ~= nil and newents[savedata.huachest] ~= nil then
inst:DoTaskInTime(0, inst.Remove)
end
end
end
AddPrefabPostInit("minisign", function(inst)
if not GLOBAL.TheWorld.ismastersim then
return inst
end
local oldOnLoadPostPass = inst.OnLoadPostPass
inst.OnLoadPostPass = function(inst, newents, savedata)
if oldOnLoadPostPass ~= nil then
oldOnLoadPostPass(inst, newents, savedata)
end
onloadpostpass(inst, newents, savedata)
end
end)
-----------------修复垃圾代码完成=============================
local function draw(inst)
if not GLOBAL.TheWorld.ismastersim then
return inst
end
inst:AddComponent("smart_minisign")
end
AddPrefabPostInit("treasurechest", draw)
if GetModConfigData("DragonflyChest") == true then
AddPrefabPostInit("dragonflychest", draw)
end
if GetModConfigData("Icebox") == true then
AddPrefabPostInit("icebox", draw)
end
if GetModConfigData("SaltBox") == true then
AddPrefabPostInit("saltbox", draw)
end
--读取所有已加载的mod
local enabledmods = GLOBAL.ModManager.enabledmods
local thisname = env.modname
--hook一下加载prefabs 加载完prefabs在检索数据
local oldRegisterPrefabs = GLOBAL.ModManager.RegisterPrefabs
GLOBAL.ModManager.RegisterPrefabs = function(self)
oldRegisterPrefabs(self)
for i,modname in ipairs(enabledmods) do
local mod = GLOBAL.ModManager:GetMod(modname)
--检索 modmain里注册的资源
if mod.Assets then
local modatlas = {}
local modatlas_build = {}
--检索所有的贴图
for k,v in ipairs (mod.Assets) do
if v.type == "ATLAS" then
table.insert(modatlas,v.file)
elseif v.type == "ATLAS_BUILD" then
table.insert(modatlas_build,v.file)
end
end
--判断是否有对应的ATLAS_BUILD
for k,v in ipairs(modatlas) do
local notfind = true
for x,y in ipairs(modatlas_build) do
if v == y then
notfind = false
break
end
end
if notfind then
--没有就插入
--因为注册的时候会自动搜索路径,所以自己注册的时候要还原回原来的路径
v = string.gsub(v,"%.%./mods/[^/]+/","",1)
table.insert(Assets,Asset("ATLAS_BUILD",v,256))
end
end
end
--检索 prefabs 里注册的资源
if mod.Prefabs then
for n,prefab in pairs(mod.Prefabs) do
local modatlas = {}
local modatlas_build = {}
--检索所有的贴图
if prefab.assets then
for k,v in pairs (prefab.assets) do
if v.type == "ATLAS" then
table.insert(modatlas,v.file)
elseif v.type == "ATLAS_BUILD" then
table.insert(modatlas_build,v.file)
end
end
end
--判断是否有对应的ATLAS_BUILD
for k,v in ipairs(modatlas) do
local notfind = true
for x,y in ipairs(modatlas_build) do
if v == y then
notfind = false
break
end
end
if notfind then
--没有就插入
v = string.gsub(v,"%.%./mods/[^/]+/","",1)
table.insert(Assets,Asset("ATLAS_BUILD",v,256))
end
end
end
end
end
--注册资源
GLOBAL.RegisterPrefabs(GLOBAL.Prefab("MOD_SMARTSIGNOTHER",nil,Assets,nil,true))
GLOBAL.TheSim:LoadPrefabs({"MOD_SMARTSIGNOTHER"})
table.insert(self.loadedprefabs,"MOD_SMARTSIGNOTHER")
end
GLOBAL.TUNING.SMART_SIGN_DRAW_ENABLE = true
GLOBAL.SMART_SIGN_DRAW = draw
--示例代码
--[[
if TUNING.SMART_SIGN_DRAW_ENABLE then
SMART_SIGN_DRAW(inst)
end
]]--

View File

@@ -0,0 +1,145 @@
local showbundle = TUNING.HUAMINISIGN_BUNDLE
local changeskin = TUNING.HUAMINISIGN_SKIN
local candig = TUNING.HUAMINISIGN_DIG
local function newminisign(inst,self)
if inst.components.drawable then
inst.components.drawable.candraw = false
end
if inst.components.workable then
if not candig then
inst:RemoveComponent("workable")
else
inst.components.workable:SetOnFinishCallback(function()
self.nohuaminisign = true
inst:Remove()
end)
end
end
if inst.components.burnable then
inst:RemoveComponent("burnable")
end
if inst.components.propagator then
inst:RemoveComponent("propagator")
end
end
local Smart_Minisign = Class(function(self, inst)
self.inst = inst
self.nohuaminisign = false
self.sign = nil
self.onclose = nil
inst:ListenForEvent("onclose", function(...) self:OnClose() end)
inst:DoTaskInTime(0.1,function (inst) --load or build
if not self.nohuaminisign then
self:SpawnSign()
self:OnClose()
end
end)
self._onremove = function(pet)
self.sign = nil
end
if inst.components.burnable ~= nil then --remove the fx after burnt
local onburnt = inst.components.burnable.onburnt or nil
inst.components.burnable.onburnt = function()
if onburnt ~= nil then
onburnt(inst)
end
if self.sign ~= nil then
self.sign:Remove()
end
end
end
end)
function Smart_Minisign:SpawnSign()
local inst = self.inst
if inst:HasTag("burnt") then --of course not
return
end
if self.sign ~= nil then --only one
return
end
local sign = SpawnPrefab("minisign")
self:LinkSign(sign)
end
function Smart_Minisign:LinkSign(minisign)
self.sign = minisign
self.inst:AddChild(minisign)
minisign.Transform:SetPosition(0, 0, 0)
self.inst:ListenForEvent("onremove", self._onremove, minisign)
minisign.persists = false
newminisign(minisign,self)
end
function Smart_Minisign:OnClose()
local inst = self.inst
if self.sign ~= nil and inst.components.container~= nil then
local container = inst.components.container
for i = 1, container:GetNumSlots() do
local item = container:GetItemInSlot(i)
if item ~= nil and item.replica.inventoryitem ~= nil then
if changeskin and item.prefab == "minisign_item" then --以旧换新
self.sign:Remove()
local sign = SpawnPrefab("minisign", item.linked_skinname, item.skin_id )
self:LinkSign(sign)
end
local image = item.replica.inventoryitem:GetImage()
local build = item.replica.inventoryitem:GetHuaAtlas()
--for bundle
if showbundle and item.components.unwrappable ~= nil and item.components.unwrappable.itemdata then
for i, v in ipairs(item.components.unwrappable.itemdata) do
if v then
local copy = SpawnPrefab(v.prefab)
if copy then
if copy.replica.inventoryitem ~= nil then
image = copy.replica.inventoryitem:GetImage()
build = copy.replica.inventoryitem:GetHuaAtlas()
end
copy:Remove()
break
end
end
end
end
self.sign.AnimState:OverrideSymbol("SWAP_SIGN", build, image)
if item.inv_image_bg and item.inv_image_bg.atlas then
self.sign.AnimState:OverrideSymbol("SWAP_SIGN_BG", resolvefilepath(item.inv_image_bg.atlas), item.inv_image_bg.image)
else
self.sign.AnimState:ClearOverrideSymbol("SWAP_SIGN_BG")
end
break
end
if i == container:GetNumSlots() and item == nil then
self.sign.AnimState:ClearOverrideSymbol("SWAP_SIGN")
self.sign.AnimState:ClearOverrideSymbol("SWAP_SIGN_BG")
end
end
end
end
function Smart_Minisign:OnSave()
return
{
nohuaminisign = self.nohuaminisign,
sign = self.sign ~= nil and self.sign:GetSaveRecord() or nil
}
end
function Smart_Minisign:OnLoad(data)
if data then
if data.nohuaminisign ~= nil then
self.nohuaminisign = data.nohuaminisign
end
if data.sign ~= nil then
local sign = SpawnSaveRecord(data.sign)
self:LinkSign(sign)
end
end
end
return Smart_Minisign

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_1.tex" /><Elements><Element name="mark_1.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_10.tex" /><Elements><Element name="mark_10.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_11.tex" /><Elements><Element name="mark_11.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_12.tex" /><Elements><Element name="mark_12.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_13.tex" /><Elements><Element name="mark_13.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_14.tex" /><Elements><Element name="mark_14.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_15.tex" /><Elements><Element name="mark_15.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_16.tex" /><Elements><Element name="mark_16.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_17.tex" /><Elements><Element name="mark_17.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_18.tex" /><Elements><Element name="mark_18.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_19.tex" /><Elements><Element name="mark_19.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_2.tex" /><Elements><Element name="mark_2.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_20.tex" /><Elements><Element name="mark_20.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_21.tex" /><Elements><Element name="mark_21.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_22.tex" /><Elements><Element name="mark_22.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_3.tex" /><Elements><Element name="mark_3.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_4.tex" /><Elements><Element name="mark_4.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_5.tex" /><Elements><Element name="mark_5.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_6.tex" /><Elements><Element name="mark_6.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_7.tex" /><Elements><Element name="mark_7.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_8.tex" /><Elements><Element name="mark_8.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

Binary file not shown.

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="mark_9.tex" /><Elements><Element name="mark_9.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

View File

@@ -0,0 +1 @@
<Atlas><Texture filename="wormhole_marks.tex" /><Elements><Element name="wormhole_marks.tex" u1="0.00390625" u2="0.99609375" v1="0.00390625" v2="0.99609375" /></Elements></Atlas>

View File

@@ -0,0 +1,37 @@
name = "Wormhole Marks"
description = ""
author = "_Q_"
version = "1.4.5"
forumthread = ""
api_version = 10
configuration_options =
{
{
name = "Draw over FoW",
options =
{
{description = "Disabled", data = "disabled"},
{description = "Enabled", data = "enabled"},
},
default = "disabled",
},
}
--This lets the clients know that they need to download the mod before they can join a server that is using it.
all_clients_require_mod = true
--This let's the game know that this mod doesn't need to be listed in the server's mod listing
client_only_mod = false
--Let the mod system know that this mod is functional with Don't Starve Together
dst_compatible = true
--These tags allow the server running this mod to be found with filters from the server listing screen
server_filter_tags = {"wormhole marks"}
icon_atlas = "modicon.xml"
icon = "wormhole_marks.tex"

View File

@@ -0,0 +1,78 @@
Assets =
{
Asset("ATLAS", "images/mark_1.xml"),
Asset("ATLAS", "images/mark_2.xml"),
Asset("ATLAS", "images/mark_3.xml"),
Asset("ATLAS", "images/mark_4.xml"),
Asset("ATLAS", "images/mark_5.xml"),
Asset("ATLAS", "images/mark_6.xml"),
Asset("ATLAS", "images/mark_7.xml"),
Asset("ATLAS", "images/mark_8.xml"),
Asset("ATLAS", "images/mark_9.xml"),
Asset("ATLAS", "images/mark_10.xml"),
Asset("ATLAS", "images/mark_11.xml"),
Asset("ATLAS", "images/mark_12.xml"),
Asset("ATLAS", "images/mark_13.xml"),
Asset("ATLAS", "images/mark_14.xml"),
Asset("ATLAS", "images/mark_15.xml"),
Asset("ATLAS", "images/mark_16.xml"),
Asset("ATLAS", "images/mark_17.xml"),
Asset("ATLAS", "images/mark_18.xml"),
Asset("ATLAS", "images/mark_19.xml"),
Asset("ATLAS", "images/mark_20.xml"),
Asset("ATLAS", "images/mark_21.xml"),
Asset("ATLAS", "images/mark_22.xml"),
}
AddMinimapAtlas("images/mark_1.xml")
AddMinimapAtlas("images/mark_2.xml")
AddMinimapAtlas("images/mark_3.xml")
AddMinimapAtlas("images/mark_4.xml")
AddMinimapAtlas("images/mark_5.xml")
AddMinimapAtlas("images/mark_6.xml")
AddMinimapAtlas("images/mark_7.xml")
AddMinimapAtlas("images/mark_8.xml")
AddMinimapAtlas("images/mark_9.xml")
AddMinimapAtlas("images/mark_10.xml")
AddMinimapAtlas("images/mark_11.xml")
AddMinimapAtlas("images/mark_12.xml")
AddMinimapAtlas("images/mark_13.xml")
AddMinimapAtlas("images/mark_14.xml")
AddMinimapAtlas("images/mark_15.xml")
AddMinimapAtlas("images/mark_16.xml")
AddMinimapAtlas("images/mark_17.xml")
AddMinimapAtlas("images/mark_18.xml")
AddMinimapAtlas("images/mark_19.xml")
AddMinimapAtlas("images/mark_20.xml")
AddMinimapAtlas("images/mark_21.xml")
AddMinimapAtlas("images/mark_22.xml")
local function Mark(inst)
if not inst.components.wormhole_marks:CheckMark() then
inst.components.wormhole_marks:MarkEntrance()
end
local other = inst.components.teleporter.targetTeleporter
if not other.components.wormhole_marks:CheckMark() then
other.components.wormhole_marks:MarkExit()
end
end
function WormholePrefabPostInit(inst)
if not inst.components.wormhole_marks then
inst:AddComponent("wormhole_marks")
end
inst:ListenForEvent("starttravelsound", Mark)
end
AddPrefabPostInit("wormhole", WormholePrefabPostInit)
function WorldPrefabPostInit(inst)
if inst:HasTag("forest") then
inst:AddComponent("wormhole_counter")
end
end
if GLOBAL.TheNet:GetIsServer() or GLOBAL.TheNet:IsDedicated() then
AddPrefabPostInit("world", WorldPrefabPostInit)
end

View File

@@ -0,0 +1,30 @@
return Class(function(self, inst)
assert(TheWorld.ismastersim, "Wormhole_Counter should not exist on client")
self.inst = inst
self.wormhole_count = 1
function self:Set()
self.wormhole_count = self.wormhole_count + 1
end
function self:Get()
return self.wormhole_count
end
function self:OnSave()
local data = {}
data.wormhole_count = self.wormhole_count
return data
end
function self:OnLoad(data)
if data then
self.wormhole_count = data.wormhole_count
else
self.wormhole_count = 1
end
end
end)

View File

@@ -0,0 +1,65 @@
local modname = KnownModIndex:GetModActualName("Wormhole Marks")
local fow_setting = GetModConfigData("Draw over FoW", modname)
local Wormhole_Marks = Class(function(self, inst)
self.inst = inst
self.marked = false
self.wormhole_number = nil
end)
function Wormhole_Marks:MarkEntrance()
self:GetNumber()
if self.wormhole_number <= 22 then
self.marked = true
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
end
end
function Wormhole_Marks:MarkExit()
self:GetNumber()
if self.wormhole_number <= 22 then
self.marked = true
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
TheWorld.components.wormhole_counter:Set()
end
end
function Wormhole_Marks:GetNumber()
self.wormhole_number = TheWorld.components.wormhole_counter:Get()
end
function Wormhole_Marks:CheckMark()
return self.marked
end
function Wormhole_Marks:OnSave()
local data = {}
data.marked = self.marked
data.wormhole_number = self.wormhole_number
return data
end
function Wormhole_Marks:OnLoad(data)
if data then
self.marked = data.marked
self.wormhole_number = data.wormhole_number
if self.marked and self.wormhole_number then
self.inst.entity:AddMiniMapEntity()
self.inst.MiniMapEntity:SetIcon("mark_"..self.wormhole_number..".tex")
if fow_setting == "enabled" then
self.inst.MiniMapEntity:SetDrawOverFogOfWar(true)
end
end
else
self.marked = false
self.wormhole_number = 0
end
end
return Wormhole_Marks

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<Atlas><Texture filename="DropEverything.tex" />
<Elements><Element name="DropEverything.tex" u1="0" u2="1" v1="0" v2="1" />
</Elements></Atlas>

View File

@@ -0,0 +1,94 @@
name = " Don't Drop Everything"
author = "Shang"
old_ver = "170403.21:59"
version = "11:15 2020-08-10"
description = "Current version"..version.."\nThe previous version"..old_ver..
"\n·Install this mod, Player deaths will not drop all items."..
"\n\n!!!我为什么是英文? ↓ ↓ ↓\n请自行搜索并订阅安装 Chinese Plus 模组。"
forumthread = ""
dont_starve_compatible = false
reign_of_giants_compatible = false
shipwrecked_compatible = false
api_version = 10
dst_compatible = true
client_only_mod = false
all_clients_require_mod = false
icon_atlas = "DropEverything.xml"
icon = "DropEverything.tex"
configuration_options =
{
{name="kong",label="Type\n\n",options={{description ="Number",data = 0,}},default=0,},
{
name = "rendiao",
label = "Body biggest drop",
hover = "The maximum number of drop character of body.",
options =
{
{description = "None", data = 0, hover = ""},
{description = "1", data = 1, hover = ""},
{description = "2", data = 2, hover = ""},
{description = "3", data = 3, hover = ""},
{description = "4", data = 4, hover = ""},
{description = "5", data = 5, hover = ""},
{description = "6", data = 6, hover = ""},
{description = "7", data = 7, hover = ""},
{description = "8", data = 8, hover = ""},
{description = "9", data = 9, hover = ""}
},
default = 2,
},
{
name = "baodiao",
label = "Backpack biggest drop",
hover = "The maximum number of drop character of backpack.",
options =
{
{description = "None", data = 0, hover = ""},
{description = "1", data = 1, hover = ""},
{description = "2", data = 2, hover = ""},
{description = "3", data = 3, hover = ""},
{description = "4", data = 4, hover = ""},
{description = "5", data = 5, hover = ""},
{description = "6", data = 6, hover = ""},
{description = "7", data = 7, hover = ""},
{description = "8", data = 8, hover = ""},
{description = "9", data = 9, hover = ""}
},
default = 1,
},
{
name = "zbdiao",
label = "Equipment drops",
hover = "Death is inevitable drop equipment. \n Prevent soul state equipment durability.",
options =
{
{description = "On", data = true, hover = ""},
{description = "Off", data = false, hover = ""}
},
default = true,
},
{
name = "amudiao",
label = "Life Amulet of filter",
hover = "Death is inevitable drop a Life Amulet.",
options =
{
{description = "On", data = true, hover = ""},
{description = "Off", data = false, hover = ""}
},
default = true,
},
{
name = "nillots",
label = "Leave a item lots empty",
hover = "Death is Leave a item lots empty",
options =
{
{description = "On", data = 0, hover = ""},
{description = "Off", data = 1, hover = ""}
},
default = 0,
}
}

View File

@@ -0,0 +1,93 @@
old_ver = "170403.21:59"
version = "11:15 2020-08-10"
description = "当前版本:"..version.." 上一版本:"..old_ver..
"\n\n·新增1、支持天体之门换人物品将全部掉落。\n2、死亡将掉落身上一个救赎之心其中也包括背包一个。\n3、新增配置留一个空格子用来检测身上有没有空格子没有掉落第一个格子的物品。"..
"\n·死亡后变成灵魂将不掉落全部物品,复活后基本不用特意去捡尸体了。"..
"\n·为PvP玩家考虑如果玩家有穿戴背包里面物品也将会随机掉落可配置"..
"\n\n!!!注意:救赎之心复活人身上至少要空闲一格,其中也包括背包空闲位置!"
h_a = "玩家死亡将"
h_b = ""
h_c = "掉落"
h_d = "不超过 "
h_e = " 格的随机格数的物品"
h_f = "任何物品"
h_g = "随机掉落,我觉得没这个必要!"
ho_a = h_a..h_b..h_c..h_f
ho_b = h_a..h_c..h_d
configuration_options =
{
{name="kong",label="项目\n\n",options={{description ="格数",data = 0,}},default=0,},
{
name = "rendiao",
label = "人身最大掉落",
hover = "下面一排格子最大掉落的物品格数",
options =
{
{description = "None", data = 0, hover = ho_a},
{description = "1", data = 1, hover = ho_b.."1"..h_e},
{description = "2", data = 2, hover = ho_b.."2"..h_e},
{description = "3", data = 3, hover = ho_b.."3"..h_e},
{description = "4", data = 4, hover = ho_b.."4"..h_e},
{description = "5", data = 5, hover = ho_b.."5"..h_e},
{description = "6", data = 6, hover = ho_b.."6"..h_e},
{description = "7", data = 7, hover = ho_b.."7"..h_e},
{description = "8", data = 8, hover = ho_b.."8"..h_e},
{description = "9", data = 9, hover = ho_b.."9"..h_e}
},
default = 2,
},
{
name = "baodiao",
label = "背包最大掉落",
hover = "背包的最大掉落的物品格数",
options =
{
{description = "None", data = 0, hover = ho_a},
{description = "1", data = 1, hover = ho_b.."1"..h_e},
{description = "2", data = 2, hover = ho_b.."2"..h_e},
{description = "3", data = 3, hover = ho_b.."3"..h_e},
{description = "4", data = 4, hover = ho_b.."4"..h_e},
{description = "5", data = 5, hover = ho_b.."5"..h_e},
{description = "6", data = 6, hover = ho_b.."6"..h_e},
{description = "7", data = 7, hover = ho_b.."7"..h_e},
{description = "8", data = 8, hover = ho_b.."8"..h_e},
{description = "9", data = 9, hover = ho_b.."9"..h_e}
},
default = 1,
},
{
name = "zbdiao",
label = "装备掉落",
hover = "死亡是否必然掉落装备\n没有肉身要如何装备?\n防止灵魂状态装备掉耐久",
options =
{
{description = "", data = true, hover = "没有肉身也能装备这不科学,我选择必然掉落"},
{description = "", data = false, hover = h_g}
},
default = true,
},
{
name = "amudiao",
label = "重生护符过滤器",
hover = "死亡是否必然掉落一只重生护身符\n避免有携带重生护符但死亡没掉出来的悲剧\n默认开!",
options =
{
{description = "", data = true, hover = "必然掉落,我遇到过这种情况,我选择掉落它!"},
{description = "", data = false, hover = h_g}
},
default = true,
},
{
name = "nillots",
label = "留一个空格子",
hover = "死亡时候检测是否有空格子,没有则掉落身体第一个格子的物品,从而可以让队友复活",
options =
{
{description = "", data = 0, hover = "激活死亡空格子检测功能"},
{description = "", data = 1, hover = "禁用死亡空格子检测功能"},
},
default = 0,
}
}

View File

@@ -0,0 +1,91 @@
description =
"\n\n·新增1、支持天體之門換人物品將全部掉落。\n2、死亡將掉落身上一個救贖之心其中也包括背包一個。\n3、新增配置留一個空格子用來檢測身上有冇有空格子冇有掉落第一個格子的物品。"..
"\n·死亡後變成靈魂將不掉落全部物品,復活後基本不用特意去撿屍體了。"..
"\n·為PvP玩家考慮如果玩家有穿戴背包裏面物品也將會隨機掉落可配置"..
"\n\n!!!註意:救贖之心復活人身上至少要空閑壹格,其中也包括背包空閑位置!"
h_a = "玩家死亡將"
h_b = ""
h_c = "掉落"
h_d = "不超過 "
h_e = " 格的隨機格數的物品"
h_f = "任何物品"
h_g = "隨機掉落,我覺得沒這個必要!"
ho_a = h_a..h_b..h_c..h_f
ho_b = h_a..h_c..h_d
configuration_options =
{
{name="kong",label="項目\n\n",options={{description ="格數",data = 0,}},default=0,},
{
name = "rendiao",
label = "人身最大掉落",
hover = "下面壹排格子最大掉落的物品格數",
options =
{
{description = "None", data = 0, hover = ho_a},
{description = "1", data = 1, hover = ho_b.."1"..h_e},
{description = "2", data = 2, hover = ho_b.."2"..h_e},
{description = "3", data = 3, hover = ho_b.."3"..h_e},
{description = "4", data = 4, hover = ho_b.."4"..h_e},
{description = "5", data = 5, hover = ho_b.."5"..h_e},
{description = "6", data = 6, hover = ho_b.."6"..h_e},
{description = "7", data = 7, hover = ho_b.."7"..h_e},
{description = "8", data = 8, hover = ho_b.."8"..h_e},
{description = "9", data = 9, hover = ho_b.."9"..h_e}
},
default = 2,
},
{
name = "baodiao",
label = "背包最大掉落",
hover = "背包的最大掉落的物品格數",
options =
{
{description = "None", data = 0, hover = ho_a},
{description = "1", data = 1, hover = ho_b.."1"..h_e},
{description = "2", data = 2, hover = ho_b.."2"..h_e},
{description = "3", data = 3, hover = ho_b.."3"..h_e},
{description = "4", data = 4, hover = ho_b.."4"..h_e},
{description = "5", data = 5, hover = ho_b.."5"..h_e},
{description = "6", data = 6, hover = ho_b.."6"..h_e},
{description = "7", data = 7, hover = ho_b.."7"..h_e},
{description = "8", data = 8, hover = ho_b.."8"..h_e},
{description = "9", data = 9, hover = ho_b.."9"..h_e}
},
default = 1,
},
{
name = "zbdiao",
label = "裝備掉落",
hover = "死亡是否必然掉落裝備\n沒有肉身要如何裝備?\n防止靈魂狀態裝備掉耐久",
options =
{
{description = "", data = true, hover = "沒有肉身也能裝備這不科學,我選擇必然掉落"},
{description = "", data = false, hover = h_g}
},
default = true,
},
{
name = "amudiao",
label = "重生護符過濾器",
hover = "死亡是否必然掉落壹只重生護身符\n避免有攜帶重生護符但死亡沒掉出來的悲劇\n默認開!",
options =
{
{description = "", data = true, hover = "必然掉落,我遇到過這種情況,我選擇掉落它!"},
{description = "", data = false, hover = h_g}
},
default = true,
},
{
name = "nillots",
label = "留一個空格子",
hover = "死亡時候檢測是否有空格子,冇有則掉落身體第一個格子的物品,從而可以讓隊友複活",
options =
{
{description = "", data = 0, hover = "激活死亡空格子檢測功能"},
{description = "", data = 1, hover = "禁用死亡空格子检测功能"},
},
default = 0,
}
}

View File

@@ -0,0 +1,102 @@
local _G = GLOBAL
local R_diao = GetModConfigData("rendiao")
local B_diao = GetModConfigData("baodiao")
local amu_diao = GetModConfigData("amudiao")
local zhuang_bei = GetModConfigData("zbdiao")
local modnillots = GetModConfigData("nillots") or 0
local R_d = R_diao - 3
local B_d = B_diao - 5
if R_d < 0 then R_d = 0 end if B_d < 0 then B_d = 0 end
AddComponentPostInit("container", function(Container, inst)
function Container:DropSuiji(ondeath)
local amu_x = true
local rev_x = true
for k=1, self.numslots do
local v = self.slots[k]
if amu_diao and amu_x and v and v.prefab == "amulet" then --掉落护符
amu_x = false
self:DropItem(v)
end
if amu_diao and rev_x and v and v.prefab == "reviver" then --掉落心脏
rev_x = false
self:DropItem(v)
end
end
for k=1, self.numslots do --随机掉落背包里的物品
local v = self.slots[math.random(1, self.numslots)]
if k > math.random(B_d, B_diao) then
return false
end
if v then
self:DropItem(v)
end
end
end
end)
AddComponentPostInit("inventory", function(Inventory, inst)
Inventory.oldDropEverythingFn = Inventory.DropEverything
function Inventory:DropSuiji(ondeath)
local amu_x = true
local rev_x = true
local nillots = modnillots
for k=1, self.maxslots do
local v = self.itemslots[k]
if amu_diao and amu_x and v and v.prefab == "amulet" then --掉落护符
amu_x = false
self:DropItem(v, true, true)
end
if amu_diao and rev_x and v and v.prefab == "reviver" then --掉落心脏
rev_x = false
self:DropItem(v, true, true)
end
end
for k=1, self.maxslots do --随机掉落身体上的物品
if k~=1 and k > math.random(R_d, R_diao) then
return false
end
if v then
self:DropItem(v, true, true)
end
end
for k=1, self.maxslots do --计算空格数量
if v == nil then
nillots = nillots + 1
end
end
if nillots == 0 then --掉落身体上一格的物品,为了能够使用心脏复活
local v = self.itemslots[1] --math.random(1, self.maxslots)
if v then
self:DropItem(v, true, true)
end
end
end
function Inventory:PlayerSiWang(ondeath)
for k, v in pairs(self.equipslots) do
if v:HasTag("backpack") and v.components.container then
v.components.container:DropSuiji(true)
end
end
if zhuang_bei then
for k, v in pairs(self.equipslots) do
if not v:HasTag("backpack") then
self:DropItem(v, true, true)
end
end
end
self.inst.components.inventory:DropSuiji(true)
end
function Inventory:DropEverything(ondeath, keepequip)
if not inst:HasTag("player") or inst:HasTag("player") and not inst.components.health --不是玩家或玩家有血则掉落全部物品
or inst:HasTag("player") and inst.components.health and inst.components.health.currenthealth > 0 then --兼容换人
return Inventory:oldDropEverythingFn(ondeath, keepequip)
else
return Inventory:PlayerSiWang(ondeath)
end
end
end)