Page 1 of 1

Amulet of Bushwalking

Posted: Sat May 23, 2015 2:32 pm
by Zo Kath Ra
Eons ago, the Adepts of Nex were faced with a problem: when they walked the forest, looking for rare herbs, bushes often blocked their path. Not only that, but the bushes also tore at the precious fabric of their expensive robes.

Out of sheer desperation, they resolved to create a powerful artifact enabling the wearer (and anyone in their party) to walk through bushes as if they did not exist.

After many moons, the Amulet of Bushwalking was completed. Ancient scrolls from this legendary time period show the code they used...

Put this in your mod's init.lua:

Code: Select all

defineObject{
    name = "party",
    baseObject = "party",
    components = {
        {
            class = "Party",
            
            onMove = function(self, dir)
                for entity in self.go.map:entitiesAt(self.go.x, self.go.y) do
                    if (entity.name == "forest_plant_cluster_01") then   -- does the tile we're currently on contain a "forest_plant_cluster_01"?
                        entity.obstacle:setBlockParty(true)   -- if it does, block it
                    end
                end
                
                local champion_wearing_amulet = false
                for i = 1, 4 do
                    local champion = self:getChampionByOrdinal(i)
                    if (champion:getItem(ItemSlot.Necklace) ~= nil) then
                        if (champion:getItem(ItemSlot.Necklace).go.name == "bushwalker_pendant") then
                            champion_wearing_amulet = true
                        end
                    end
                end
                
                if (champion_wearing_amulet) then
                    local dx,dy = getForward(dir)
                    for entity in self.go.map:entitiesAt(self.go.x + dx, self.go.y + dy) do
                        if (entity.name == "forest_plant_cluster_01") then   -- does the tile we're moving onto contain a "forest_plant_cluster_01"?
                            entity.obstacle:setBlockParty(false)   -- if it does, unblock it
                        end
                    end
                end
            end,
            
            onTurn = function(self, direction)
                for entity in self.go.map:entitiesAt(self.go.x, self.go.y) do
                    if (entity.name == "forest_plant_cluster_01") then   -- does the tile we're currently on contain a "forest_plant_cluster_01"?
                        entity.obstacle:setBlockParty(true)   -- if it does, block it
                    end
                end
            end
        }
    }
}
And this in items.lua:

Code: Select all

defineObject{
	name = "bushwalker_pendant",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/spiritwalker_pendant.fbx",
		},
		{
			class = "Item",
			uiName = "Amulet of Bushwalking",
			description = "This powerful amulet lets you walk through bushes!",
			gfxIndex = 307,
			weight = 0.3,
			traits = { "necklace" },
		},
	},
}

Re: Amulet of Bushwalking

Posted: Sat May 23, 2015 6:10 pm
by petri
Hah! Awesome concept! Little details like the history of the amulet really give life to the setting. This is how we approached the design of items and monsters and other lore elements. Not all of it is revealed in the game but the thought process behind the desings make the island a consistent place I believe.

:)

Re: Amulet of Bushwalking

Posted: Sat May 23, 2015 11:26 pm
by bongobeat
great stuff! thanks :D

Re: Amulet of Bushwalking

Posted: Sun May 24, 2015 12:00 am
by Azel
Love the Amulet! Although... I'm not sure I'm ready to let ya' in to my brush, na mean? :shock:

Re: Amulet of Bushwalking

Posted: Sun May 24, 2015 6:38 pm
by Dr.Disaster
;) i had to check the item name twice to make sure it's not an
SpoilerShow
Amulet of Bushwhacking