Might not necessarily be considered a bug, but hey, would be a neat detail, and this game is a lot about details. Just add rainimmunity component checks to the nodes in the block down below, in hermitcrabbrain.
IfNode( function() return not self.inst.sg:HasStateTag("busy") and TheWorld.state.israining and has_umbrella(self.inst) and not using_umbrella(self.inst) end, "umbrella", DoAction(self.inst, EquipUmbrella, "umbrella", true )), IfNode( function() return not self.inst.sg:HasStateTag("busy") and not TheWorld.state.israining and using_umbrella(self.inst) end, "stop umbrella", DoAction(self.inst, UnEquipHands, "stop umbrella", true )),
This won't affect her task to be given an umbrella, it's just flavor.
EDIT: this did end up causing some buggy behavior because I misinterpreted something, but it can be addressed, and it's worth taking a look as it could be exploited.
Turns out that when the game unequips something from her and gives it back to her to store it in her inventory, it will fire up a "getitem" event, which she listens to to potentially complete a task. The following block of code in her prefab could be changed from:
elseif data.item:HasTag("umbrella") and TheWorld.state.israining then inst.components.inventory:Equip(data.item) inst.components.friendlevels:CompleteTask(TASKS.GIVE_UMBRELLA) elseif iscoat(data.item) and TheWorld.state.issnowing then inst.components.inventory:Equip(data.item) inst.components.friendlevels:CompleteTask(TASKS.GIVE_PUFFY_VEST)
To:
elseif data.item:HasTag("umbrella") then if TheWorld.state.israining then if inst.components.rainimmunity == nil then inst.components.inventory:Equip(data.item) end if data.src_pos then --hacky way to check to see if we received the item from someone inst.components.friendlevels:CompleteTask(TASKS.GIVE_UMBRELLA) end end elseif iscoat(data.item) then if TheWorld.state.issnowing then inst.components.inventory:Equip(data.item) if data.src_pos then --hacky way to check to see if we received the item from someone inst.components.friendlevels:CompleteTask(TASKS.GIVE_PUFFY_VEST) end end
As the comments I put in there suggest, the src_pos check is hacky, and could be addressed more properly, but you get the point.
All this would result in her being able to:
- Receive an umbrella while under an umbralla dome, and not equip it.
- Equip and unequip an umbrella based on being inside a dome or not.
- Give rewards even without equipping the umbrella, if she was given one (the game already verifies if she has one in her inventory or hand, to reject extra ones, although, checking for a better umbrella isn't a thing, and it could be added too).
- Ensure that if she somehow unequips an umbrella or coat while it's raining or snowing, respectively, she won't give out a reward again if she immediately equips either of those again.
- Give Pearl an umbrella while it's raining.
- Drop and activate an umbralla near her.
- Observe how she will still use the umbrella you gave her while inside the umbralla dome.
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now