FILES ----- codex\documents\avianafterlife.codex codex\documents\hylotlprologue.codex monsters\ground\hugebiped\hugebiped.animation monsters\ground\hugebiped\hugebiped.monstertype monsters\ground\hugebiped\hugebiped.partparams monsters\ground\skills\meleeattack.monsterskill monsters\pets\groundpet.lua monsters\pets\actions\inspectaction.lua monsters\pets\actions\pounceaction.lua monsters\pets\cat\catbehavior.lua monsters\pets\cat\petcat.monstertype objects\generic\statuspod\statuspod.object [NEW] projectiles\npcs\hugemeleeslash\hugemeleeslash.frames [NEW] projectiles\npcs\hugemeleeslash\hugemeleeslash.png [NEW] projectiles\npcs\hugemeleeslash\hugemeleeslash.projectile DIFFS ----- codex\documents\avianafterlife.codex 7,10c7 < Those who serve Kluex with passion and dedication in this life are said to regain their wings in the next. It is the Avians' ultimate goal; to regain the power of flight, and join our gods in the afterlife.", < < < --- > Those who serve Kluex with passion and dedication in this life are said to regain their wings in the next. It is the Avians' ultimate goal; to regain the power of flight, and join our gods in the afterlife." codex\documents\hylotlprologue.codex 2c2 < "id" : "humanprologue", --- > "id" : "hylotlprologue", monsters\ground\hugebiped\hugebiped.animation 125c125 < "image" : ":idle." --- > "image" : ":walk." 209c209 < "image" : ":idle." --- > "image" : ":walk." 305,323d304 < < "attack" : { < "melee" : { < "properties" : { < "image" : ":melee." < } < }, < "charge" : { < "properties" : { < "image" : ":melee.3" < } < }, < "chargeAttack" : { < "properties" : { < "image" : ":melee." < } < } < }, < monsters\ground\hugebiped\hugebiped.monstertype 25d24 < "/monsters/ground/aggroHopState.lua", 65a65,70 > [ > { > "baseSkills" : [ "meleeAttack" ], > "specialSkills" : [ "chargeAttack" ] > } > ] 86c91 < "poly" : [ [-1.5, -3.9], [1.5, -3.9], [1.5, 0.85], [-1.5, 0.85] ], --- > "poly" : [ [-3, -9.375], [3, -9.375], [3, 2], [-3, 2] ], monsters\ground\hugebiped\hugebiped.partparams 11,12c11,12 < "projectileSourcePosition" : [ "override", [1.0, 0.0] ], < "meleeProjectile" : [ "override", "chomp4" ] --- > "projectileSourcePosition" : [ "override", [3.0, -3] ], > "meleeProjectile" : [ "override", "hugemeleeslash" ] monsters\ground\skills\meleeattack.monsterskill 15c15 < "projectile" : "chomp4", //can override this in individual .monstertype with a meleeAttackProjectile parameter --- > "projectile" : "chomp4", //can override this in individual .monstertype with a meleeProjectile parameter monsters\pets\groundpet.lua 39a40 > self.actionCooldowns = {} 102c103,104 < includedTypes = { "player", "itemDrop", "monster" } --- > includedTypes = { "player", "itemDrop", "monster" }, > withoutEntityId = entity.id() 188a191,194 > > for actionName,cooldown in pairs(self.actionCooldowns) do > self.actionCooldowns[actionName] = cooldown - dt > end monsters\pets\actions\inspectaction.lua 5,6c5 < if not args.inspectTarget or not args.approachDistance then return nil end < --- > if not args.inspectTarget or not args.approachDistance or self.inspected[args.inspectTarget] then return nil end 26a26,29 > if stateData.didEmote then > stateData.inspectTimer = stateData.inspectTimer - dt > end > 38a42 > entity.setAnimationState("movement", "inspect") 41,43c45,46 < --inspect < entity.setAnimationState("movement", "inspect") < stateData.inspectTimer = stateData.inspectTimer - dt --- > local toTarget = world.distance(targetPosition, mcontroller.position()) > mcontroller.controlFace(toTarget[1]) 44a48 > --Form an opinion about the target 45a50,60 > local entityType = world.entityType(stateData.inspectTarget) > > if entityType == "itemdrop" and root.itemType(world.entityName(stateData.inspectTarget)) == "consumable" then > inspectAction.inspectFood(stateData.inspectTarget) > end > > if entityType == "monster" then > inspectAction.inspectMonster(stateData.inspectTarget) > end > > self.inspected[stateData.inspectTarget] = true 53,55c68,74 < function inspectAction.leavingState(stateData) < if stateData.inspected and stateData.followUpAction then < self.behavior.performAction(stateData.followUpAction) --- > function inspectAction.inspectFood(targetId) > local itemName = world.entityName(targetId) > local foodLiking = itemFoodLiking(itemName) > > if foodLiking == nil then > foodLiking = math.random(100) > storage.behaviorParams.food[itemName] = foodLiking 56a76,95 > end > > function inspectAction.inspectMonster(targetId) > local monsterType = world.monsterType(targetId) > local monsterLiking = storage.behaviorParams.monsters[monsterType] > > if monsterLiking == nil then > monsterLiking = math.random(100) > 50 > storage.behaviorParams.monsters[monsterType] = monsterLiking > end > > if monsterLiking then > emote("happy") > else > emote("sad") > end > end > > function inspectAction.leavingState(stateData) > status.modifyResource("curiosity", -20) monsters\pets\actions\pounceaction.lua 23c23,24 < didPounce = false --- > didPounce = false, > emote = args.emote 52a54,57 > > if stateData.emote then > emote(stateData.emote) > end 66,69c71,72 < if stateData.didPounce and stateData.followUpAction then < self.behavior.performAction(stateData.followUpAction) < end < end --- > status.modifyResource("playful", -30) > end \ No newline at end of file monsters\pets\cat\catbehavior.lua 18c18,19 < ["pounce"] = catBehavior.pounce --- > ["pounce"] = catBehavior.pounce, > ["play"] = catBehavior.play 19a21,26 > > for actionName,_ in pairs(catBehavior.actions) do > self.actionCooldowns[actionName] = 0 > end > > self.inspected = {} 22,23c29,32 < function catBehavior.queueAction(type, args) < table.insert(catBehavior.actionQueue, {type = type, args = args}) --- > --Queue an action to later be sorted by score > --score is optional > function catBehavior.queueAction(type, args, score) > table.insert(catBehavior.actionQueue, {type = type, args = args, score = score}) 27c36 < if catBehavior.actions[action.type] then --- > if catBehavior.actions[action.type] and self.actionCooldowns[action.type] <= 0 and self.actionState.stateDesc() == "" then 33a43 > --Score all actions in the queue, then try them until one returns a success 37c47,49 < action.score = catBehavior.scoreAction(action) --- > if action.score == nil then > action.score = catBehavior.scoreAction(action) > end 43a56 > self.actionCooldowns[action] = entity.configParameter("actionCooldowns")[action.type] 50a64 > --Evaluate an action and set a weight 55a70 > 58a74 > 60a77 > 62,63c79,81 < if action.args[3] then < return catBehavior.scoreAction(action.args[3]) --- > local entityType = world.entityType(action.args[1]) > if entityType == "itemdrop" and root.itemType(world.entityName(action.args[1])) == "consumable" then > return (status.resource("curiosity") + status.resource("hunger")) / 2 65c83 < return 50 --TODO: Tie this to a resource, curiosity? --- > return status.resource("curiosity") 66a85 > 68c87,92 < return 50 --- > --Often attack aggressive monsters > return 60 > > elseif action.type == "play" then > --Often attack aggressive monsters > return status.resource("playful") 88a113,115 > --Maybe play > catBehavior.queueAction("play", {entityId}) > 93,94c120,121 < if foodLiking and 100 - foodLiking/2 < status.resource("hunger") then < catBehavior.queueAction("beg", {entityId, 3}) --- > if foodLiking then > catBehavior.queueAction("beg", {entityId, 3, foodLiking}) 109c136 < --No reaction --- > catBehavior.queueAction("inspect", {entityId, 5}) 117,119c144 < if 100 - foodLiking < status.resource("hunger") then < catBehavior.queueAction("eat", {entityId, 2}) < end --- > catBehavior.queueAction("eat", {entityId, 2, foodLiking}) 121c146 < catBehavior.queueAction("inspect", {entityId, 2, {type = "eat", args = {entityId, 2}}}) --- > catBehavior.queueAction("inspect", {entityId, 2}) 128c153,161 < catBehavior.queueAction("pounce", {entityId, {type = "emote", args = {"sad"}}}) --- > catBehavior.queueAction("pounce", {entityId, "sad"}, 100) > else > local monsterType = world.monsterType(entityId) > > if storage.behaviorParams.monsters[monsterType] == nil then > catBehavior.queueAction("inspect", {entityId, 5}) > elseif storage.behaviorParams.monsters[monsterType] == true then > catBehavior.queueAction("pounce", {entityId, "happy"}) > end 137,141c170,172 < if self.actionState.stateDesc() == "" then < return self.actionState.pickState({ < followTarget = entityId < }) < end --- > return self.actionState.pickState({ > followTarget = entityId > }) 144,150c175,177 < function catBehavior.inspect(entityId, approachDistance, followUpAction) < if self.actionState.stateDesc() == "" then < return self.actionState.pickState({ < inspectTarget = entityId, < approachDistance = approachDistance, < followUpAction = followUpAction --Optional < }) --- > function catBehavior.inspect(entityId, approachDistance) > if status.resource("curiosity") < 30 then > return false 151a179,183 > > return self.actionState.pickState({ > inspectTarget = entityId, > approachDistance = approachDistance > }) 154,159c186,188 < function catBehavior.eat(entityId, approachDistance) < if self.actionState.stateDesc() == "" then < return self.actionState.pickState({ < eatTarget = entityId, < approachDistance = approachDistance < }) --- > function catBehavior.eat(entityId, approachDistance, foodLiking) > if 100 - foodLiking > status.resource("hunger") then > return false 160a190,194 > > return self.actionState.pickState({ > eatTarget = entityId, > approachDistance = approachDistance > }) 163,168c197,199 < function catBehavior.beg(entityId, approachDistance) < if self.actionState.stateDesc() == "" then < return self.actionState.pickState({ < begTarget = entityId, < approachDistance = approachDistance < }) --- > function catBehavior.beg(entityId, approachDistance, foodLiking) > if 100 - foodLiking > status.resource("hunger") then > return false 169a201,205 > > return self.actionState.pickState({ > begTarget = entityId, > approachDistance = approachDistance > }) 177,184c213,228 < function catBehavior.pounce(entityId, followUpAction) < if self.actionState.stateDesc() == "" then < world.logInfo("Pouncing monster!") < return self.actionState.pickState({ < pounceTarget = entityId, < followUpAction = followUpAction --Optional < }) < end --- > function catBehavior.pounce(entityId, emote) > return self.actionState.pickState({ > pounceTarget = entityId, > emote = emote --Optional > }) > end > > function catBehavior.play(entityId) > if status.resource("playful") < 50 then > return false > end > > return self.actionState.pickState({ > pounceTarget = entityId, > emote = "happy" > }) monsters\pets\cat\petcat.monstertype 35c35,37 < "food" : {} --- > "food" : {}, > "monsters" : { > } 40c42,44 < "hunger" : 10 --- > "hunger" : 10, > "playful" : 60, > "curiosity" : 60 43,44c47,59 < "sleepy" : 1, < "hunger" : 0.5 --- > "sleepy" : 0.5, > "hunger" : 0.5, > "playful" : 1, > "curiosity" : 1 > }, > > "actionCooldowns" : { > "inspect" : 20, > "play" : 2, > "pounce" : 5, > "eat" : 5, > "beg" : 20, > "follow" : 0 139a155,162 > "maxValue" : 100, > "defaultPercentage" : 10 > }, > "playful" : { > "maxValue" : 100, > "defaultPercentage" : 10 > }, > "curiosity" : { objects\generic\statuspod\statuspod.object 4a5,6 > "hasObjectItem" : false, >