Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PrefabFiles = {
- "warden",
- "warden_none",
- }
- Assets = {
- Asset( "IMAGE", "images/saveslot_portraits/warden.tex" ),
- Asset( "ATLAS", "images/saveslot_portraits/warden.xml" ),
- Asset( "IMAGE", "images/selectscreen_portraits/warden.tex" ),
- Asset( "ATLAS", "images/selectscreen_portraits/warden.xml" ),
- Asset( "IMAGE", "images/selectscreen_portraits/warden_silho.tex" ),
- Asset( "ATLAS", "images/selectscreen_portraits/warden_silho.xml" ),
- Asset( "IMAGE", "bigportraits/warden.tex" ),
- Asset( "ATLAS", "bigportraits/warden.xml" ),
- Asset( "IMAGE", "images/map_icons/warden.tex" ),
- Asset( "ATLAS", "images/map_icons/warden.xml" ),
- Asset( "IMAGE", "images/avatars/avatar_warden.tex" ),
- Asset( "ATLAS", "images/avatars/avatar_warden.xml" ),
- Asset( "IMAGE", "images/avatars/avatar_ghost_warden.tex" ),
- Asset( "ATLAS", "images/avatars/avatar_ghost_warden.xml" ),
- Asset( "IMAGE", "images/avatars/self_inspect_warden.tex" ),
- Asset( "ATLAS", "images/avatars/self_inspect_warden.xml" ),
- Asset( "IMAGE", "images/names_warden.tex" ),
- Asset( "ATLAS", "images/names_warden.xml" ),
- Asset( "IMAGE", "images/names_gold_warden.tex" ),
- Asset( "ATLAS", "images/names_gold_warden.xml" ),
- }
- AddMinimapAtlas("images/map_icons/warden.xml")
- local require = GLOBAL.require
- local STRINGS = GLOBAL.STRINGS
- -- The character select screen lines
- STRINGS.CHARACTER_TITLES.warden = "The Wall"
- STRINGS.CHARACTER_NAMES.warden = "Warden"
- STRINGS.CHARACTER_DESCRIPTIONS.warden = "*Tough\n*Hates Pickaxes\n*He is what he eats\n*Spreads Warmth\n*Slow"
- STRINGS.CHARACTER_QUOTES.warden = "\"Rock candy tastes nothing like rocks!\""
- STRINGS.CHARACTER_SURVIVABILITY.warden = "Rocky"
- -- Custom speech strings
- STRINGS.CHARACTERS.WARDEN = require "speech_warden"
- -- The character's name as appears in-game
- STRINGS.NAMES.WARDEN = "Warden"
- STRINGS.SKIN_NAMES.warden_none = "Warden"
- -- The skins shown in the cycle view window on the character select screen.
- -- A good place to see what you can put in here is in skinutils.lua, in the function GetSkinModes
- local skin_modes = {
- {
- type = "ghost_skin",
- anim_bank = "ghost",
- idle_anim = "idle",
- scale = 0.75,
- offset = { 0, -25 }
- },
- }
- -- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.
- AddModCharacter("warden", "ROBOT", skin_modes)
- local food_stat_dict = {
- flint = { health = 0, hunger = 15 },
- rocks = { health = 0, hunger = 5 },
- goldnugget = { hunger = 0 },
- nitre = { health = 5, hunger = 5 },
- moonrocknugget = { health = 0, sanity = 10, hunger = 5 },
- redgem = { health = 50, sanity = 0, hunger = 0 },
- orangegem = { health = 25, sanity = 0, hunger = 25 },
- yellowgem = { health = 0, sanity = 0, hunger = 50 },
- greengem = { health = 0, sanity = 25, hunger = 25 },
- bluegem = { health = 0, sanity = 50, hunger = 0 },
- purplegem = { health = 25, sanity = 25, hunger = 0 },
- opalgem = { health = 50, sanity = 50, hunger = 50 },
- thulecite = { health = 300, sanity = 50, hunger = 100 },
- }
- for food_prefab, food_stats in pairs(food_stat_dict) do
- AddPrefabPostInit(food_prefab, function(inst)
- inst.components.edible.healthvalue = food_stats["health"] or 0
- inst.components.edible.hungervalue = food_stats["hunger"] or 0
- inst.components.edible.sanityvalue = food_stats["sanity"] or 0
- end)
- end
- local ACTIONS = GLOBAL.ACTIONS
- local myactions = {}
- myactions[ACTIONS.MINE] = 3
- local multiact = AddAction("MULTI", "Work", function(act)
- if act.target.components.workable then
- local action = act.target.components.workable.action
- local numworks = myactions[action] or 1
- act.target.components.workable:WorkedBy(act.doer, numworks)
- end
- return true
- end)
- multiact.lmb = trueAddStategraphActionHandler("wilson", GLOBAL.ActionHandler(multiact, "multi"))
- AddStategraphState("wilson", GLOBAL.State { name = "multi", tags = {"notalking", "autopredict"}, onenter = function(inst)
- inst.sg.statemem.action = inst:GetBufferedAction()
- local target = inst.sg.statemem.action and inst.sg.statemem.action.target or nil
- inst.components.locomotor:Stop()
- inst.AnimState:PlayAnimation("throw")
- inst.sg:SetTimeout(cooldown)
- if target and target:IsValid() then
- inst:FacePoint(target.Transform:GetWorldPosition())
- end
- end, timeline = {
- GLOBAL.TimeEvent(7 * GLOBAL.FRAMES, function(inst)
- inst:PerformBufferedAction() end),
- GLOBAL.TimeEvent(16 * GLOBAL.FRAMES, function(inst)
- if
- inst.components.playercontroller
- and inst.components.playercontroller:IsAnyOfControlsPressed(GLOBAL.CONTROL_SECONDARY,GLOBAL.CONTROL_ACTION, GLOBAL.CONTROL_CONTROLLER_ALTACTION)
- and inst.sg.statemem.action
- and inst.sg.statemem.action.target
- and inst.sg.statemem.action.target.components.workable
- and inst.sg.statemem.action.target.components.workable.workleft > 0 then
- inst:PushBufferedAction(inst.sg.statemem.action)
- end
- end),
- },
- events = {
- GLOBAL.EventHandler("animover", function(inst)
- if inst.AnimState:AnimDone() then
- inst.sg:GoToState("idle", true)
- end
- end),
- },
- })
- --- --- ---
- local function multiLeftActions(inst, target, position)
- if target and (target:HasTag("MINE_workable")) then
- -- use tags or replicas, not components
- return inst.components.playeractionpicker:SortActionList({ ACTIONS.MULTI }, target) -- hosts and clients have playeractionpicker component
- end return nil, true
- end-- this true enables the old right actionsend
- AddComponentPostInit("playeractionpicker", function(self)
- if self.inst:HasTag("multitasker") then
- self.leftclickoverride = multiLeftActions
- end
- end)
Add Comment
Please, Sign In to add comment