Skip to content

Commit

Permalink
Turned Shop Mushroom into a map sprite.
Browse files Browse the repository at this point in the history
Improved him to make it more recognizable.

Refs #391
  • Loading branch information
Yohann Ferreira committed Jan 9, 2019
1 parent d48286f commit fe0d6e6
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 45 deletions.
3 changes: 2 additions & 1 deletion LICENSES.txt
@@ -1,7 +1,7 @@
Licenses
========

Last update: 2018.07.05
Last update: 2019.01.09

This file is listing all the files licenses from the point of the fork
from the Allacrost project.
Expand Down Expand Up @@ -350,6 +350,7 @@ data/entities/map/npcs/npc_woman01_walk.png GP
data/entities/map/npcs/npc_woman02_walk.png GPLv2+ Allacrost
data/entities/map/npcs/npc_woman03_walk.png CC-BY-SA-3.0 Jetrel (OGA) + Bertram's work.
data/entities/map/npcs/soldier_on_horse.png CC-BY-SA-3.0 Lilou (OGA) - https://opengameart.org/content/dark-soldier-on-a-horse-valyria-tear
data/entities/map/npcs/friendly_mushroom_spritesheet.png GPLv2+ Yuuki (With Bertram modifications) - The Mana World - https://www.themanaworld.org

data/entities/map/npcs/story/carson_walk.png GPLv2+ Allacrost
data/entities/map/npcs/story/malta_walk.png GPLv2+ Allacrost
Expand Down
16 changes: 0 additions & 16 deletions data/entities/map/enemies/spiky_mushroom_idle_object.lua

This file was deleted.

35 changes: 35 additions & 0 deletions data/entities/map/npcs/friendly_mushroom_idle.lua
@@ -0,0 +1,35 @@
-- Sprite animation file descriptor
-- This file will describe the frames used to load the sprite animations

-- This files is following a special format compared to other animation scripts.

local ANIM_SOUTH = vt_map.MapMode.ANIM_SOUTH;
local ANIM_NORTH = vt_map.MapMode.ANIM_NORTH;
local ANIM_WEST = vt_map.MapMode.ANIM_WEST;
local ANIM_EAST = vt_map.MapMode.ANIM_EAST;


sprite_animation = {

-- The file to load the frames from
image_filename = "data/entities/map/npcs/friendly_mushroom_spritesheet.png",
-- The number of rows and columns of images, will be used to compute
-- the images width and height, and also the frames number (row x col)
rows = 4,
columns = 1,
-- The frames duration in milliseconds
frames = {
[ANIM_SOUTH] = {
[0] = { id = 0, duration = 0 } -- 0 means forever
},
[ANIM_NORTH] = {
[0] = { id = 2, duration = 0 }
},
[ANIM_WEST] = {
[0] = { id = 1, duration = 0 }
},
[ANIM_EAST] = {
[0] = { id = 3, duration = 0 }
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions data/entities/map_objects.lua
Expand Up @@ -497,14 +497,6 @@ objects["Sauce Pot1"] = {
img_height = 2.0 * 16
}

objects["Shroom"] = {
animation_filename = "data/entities/map/enemies/spiky_mushroom_idle_object.lua",
coll_half_width = 0.9 * 16,
coll_height = 1.9 * 16,
img_half_width = 1.25 * 16,
img_height = 2.6 * 16
}

objects["Stone Sign1"] = {
animation_filename = "data/entities/map/objects/stone_sign1.lua",
coll_half_width = 1.03 * 16,
Expand Down
16 changes: 16 additions & 0 deletions data/entities/map_sprites.lua
Expand Up @@ -266,6 +266,22 @@ sprites["Man1"] = {
}
}

sprites["Shop Mushroom"] = {
name = vt_system.Translate("Dandy Shroom"),
coll_half_width = 0.9 * 16,
coll_height = 1.9 * 16,
img_half_width = 1.25 * 16,
img_height = 2.6 * 16,
movement_speed = ENEMY_SPEED,
--face_portrait = "",

-- using special animation files.
standard_animations = {
idle = "data/entities/map/npcs/friendly_mushroom_idle.lua",
walk = "data/entities/map/npcs/friendly_mushroom_idle.lua"
},
}

-- Used as a NPC to get portrait support
sprites["Crystal"] = {
name = vt_system.Translate("Crystal"), -- default name
Expand Down
39 changes: 19 additions & 20 deletions data/story/mt_elbrus/mt_elbrus_path2_script.lua
Expand Up @@ -120,6 +120,25 @@ function _CreateCharacters()
orlinn:SetMovementSpeed(vt_map.MapMode.NORMAL_SPEED);
orlinn:SetCollisionMask(vt_map.MapMode.NO_COLLISION);
orlinn:SetVisible(false);

-- Mushroom shop!
local dialogue = vt_map.SpriteDialogue.Create()
local text = vt_system.Translate("Please, don't hurt me, my life is already so short!")
dialogue:AddLineEmote(text, nil, "exclamation")
text = vt_system.Translate("What about buying some items instead?")
dialogue:AddLineEvent(text, nil, "", "Shroom Shop")

local event = vt_map.ShopEvent.Create("Shroom Shop", "Shroom Shop")
event:AddItem(1, 0) -- infinite minor potions
event:AddItem(2, 0) -- infinite medium potions
event:AddItem(11, 0) -- infinite minor moon juice
event:AddItem(1001, 0) -- infinite minor elixirs
event:SetPriceLevels(vt_shop.ShopMode.SHOP_PRICE_POOR,
vt_shop.ShopMode.SHOP_PRICE_POOR)

local shroom = CreateSprite(Map, "Shop Mushroom", 8, 10, vt_map.MapMode.GROUND_OBJECT)
shroom:AddDialogueReference(dialogue)

end

-- The heal particle effect map object
Expand Down Expand Up @@ -148,26 +167,6 @@ function _CreateObjects()
dialogue:AddLineEvent(text, nil, "Heal event", ""); -- nil means no portrait and no name
vt_map.DialogueEvent.Create("Heal dialogue", dialogue);

-- Mushroom shop!
dialogue = vt_map.SpriteDialogue.Create();
text = vt_system.Translate("Please, don't hurt me, my life is already so short!");
dialogue:AddLineEmote(text, nil, "exclamation");
text = vt_system.Translate("What about buying some items instead?");
dialogue:AddLine(text, nil);
event = vt_map.DialogueEvent.Create("Shroom dialogue", dialogue);
event:AddEventLinkAtEnd("Shroom Shop");

event = vt_map.ShopEvent.Create("Shroom Shop", "Shroom Shop");
event:AddItem(1, 0); -- infinite minor potions
event:AddItem(2, 0); -- infinite medium potions
event:AddItem(11, 0); -- infinite minor moon juice
event:AddItem(1001, 0); -- infinite minor elixirs
event:SetPriceLevels(vt_shop.ShopMode.SHOP_PRICE_POOR,
vt_shop.ShopMode.SHOP_PRICE_POOR);

local shroom = CreateObject(Map, "Shroom", 8, 10, vt_map.MapMode.GROUND_OBJECT);
shroom:SetEventWhenTalking("Shroom dialogue");

-- Objects array
local map_objects = {

Expand Down

0 comments on commit fe0d6e6

Please sign in to comment.