Skip to content
Browse files

Added the map scene where you encountered the boss the first time.

Unfortunately, the boss battle sprite isn't ready yet, so you'll
actually encounter a slime instead in the meanwhile.

The event will trigger again and again, as it is WIP.
  • Loading branch information...
1 parent dfb4ce4 commit ff930130182e9939e5ce616166a417e98736184b Yohann Ferreira committed
View
4 LICENSES
@@ -1,7 +1,7 @@
Licenses
========
-Last update: 2012.09.20
+Last update: 2012.09.24
This file is listing all the files licenses from the point of the fork
from the Allacrost project.
@@ -277,6 +277,7 @@ img/sprites/map/enemies/naga_walk.png GPLv2
img/sprites/map/enemies/scorpion_walk.png GPLv2 Allacrost
img/sprites/map/enemies/slime_walk.png GPLv2 Allacrost
img/sprites/map/enemies/snake_walk.png GPLv2 Allacrost
+img/sprites/map/enemies/wolf_spritesheet.png GPLv2 The Mana World
img/sprites/map/npcs/mak_hound.png GPLv2 Allacrost
img/sprites/map/npcs/mak_hound_mounted.png GPLv2 Allacrost
@@ -386,6 +387,7 @@ mus/koertes-ccby-birdsongloop16s.ogg CC by SA 3.0
mus/Soliloquy_1-OGA-mat-pablo.ogg CC by SA 3.0, GPLv3 Mathew Pablo (OGA)
+snd/growl1_IFartInUrGeneralDirection_freesound.wav CC by SA 3.0, GPLv2 or 3 IFartInUrGeneralDirection from freesound.org
snd/itempick2_michel_baradari_oga.wav CC by 3.0 Michel Baradari (OGA) from here: http://www.cubeengine.com/forum.php4?action=display_thread&thread_id=2164
snd/lightning.wav CC0 (Bertram)
snd/new_game.wav GPLv2 (Same sound than the opening_sword_fall.wav) file from Allacrost.
View
39 dat/actors/map_sprites.lua
@@ -302,7 +302,7 @@ sprites["Squirrel"] = {
-- ---------
-- Enemies
-- ---------
-enemies["slime"] = {
+sprites["slime"] = {
coll_half_width = 0.6,
coll_height = 1.0,
img_half_width = 0.6,
@@ -316,7 +316,7 @@ enemies["slime"] = {
}
-enemies["snake"] = {
+sprites["snake"] = {
coll_half_width = 1.0,
coll_height = 2.0,
img_half_width = 1.0,
@@ -330,7 +330,7 @@ enemies["snake"] = {
}
-enemies["scorpion"] = {
+sprites["scorpion"] = {
coll_half_width = 1.0,
coll_height = 2.0,
img_half_width = 1.0,
@@ -343,6 +343,21 @@ enemies["scorpion"] = {
}
}
+sprites["Wolf"] = {
+ name = hoa_system.Translate("Wolf"),
+ coll_half_width = 1.5,
+ coll_height = 3.0,
+ img_half_width = 1.5,
+ img_height = 3.0,
+ movement_speed = NORMAL_SPEED,
+
+ -- using special animation files.
+ standard_animations = {
+ idle = "img/sprites/map/enemies/wolf_idle.lua",
+ walk = "img/sprites/map/enemies/wolf_walk.lua"
+ }
+}
+
sprite = {}
enemy = {}
@@ -476,7 +491,7 @@ end
function CreateEnemySprite(Map, name)
- if (enemies[name] == nil) then
+ if (sprites[name] == nil) then
print("Error: No object named: "..name.." found!!");
return nil;
end
@@ -490,14 +505,14 @@ function CreateEnemySprite(Map, name)
enemy:SetSpriteName(name); -- The catalog reference
enemy:SetObjectID(Map.object_supervisor:GenerateObjectID());
enemy:SetContext(hoa_map.MapMode.CONTEXT_01);
- enemy:SetCollHalfWidth(enemies[name].coll_half_width);
- enemy:SetCollHeight(enemies[name].coll_height);
- enemy:SetImgHalfWidth(enemies[name].img_half_width);
- enemy:SetImgHeight(enemies[name].img_height);
- enemy:SetMovementSpeed(enemies[name].movement_speed);
-
- enemy:LoadStandingAnimations(enemies[name].standard_animations.idle);
- enemy:LoadWalkingAnimations(enemies[name].standard_animations.walk);
+ enemy:SetCollHalfWidth(sprites[name].coll_half_width);
+ enemy:SetCollHeight(sprites[name].coll_height);
+ enemy:SetImgHalfWidth(sprites[name].img_half_width);
+ enemy:SetImgHeight(sprites[name].img_height);
+ enemy:SetMovementSpeed(sprites[name].movement_speed);
+
+ enemy:LoadStandingAnimations(sprites[name].standard_animations.idle);
+ enemy:LoadWalkingAnimations(sprites[name].standard_animations.walk);
return enemy;
end
View
165 dat/maps/layna_forest/layna_forest_north_east.lua
@@ -398,9 +398,20 @@ function _CreateCharacters()
Map:AddGroundObject(hero);
end
+-- The boss map sprite
+local wolf = {};
+
function _CreateObjects()
local object = {}
local npc = {}
+
+ -- The boss map sprite
+ wolf = CreateSprite(Map, "Wolf", 104, 3); -- pre place it at the right place.
+ wolf:SetCollisionMask(hoa_map.MapMode.NO_COLLISION);
+ wolf:SetMovementSpeed(hoa_map.MapMode.VERY_FAST_SPEED);
+ wolf:SetVisible(false);
+ wolf:SetDirection(hoa_map.MapMode.SOUTH);
+ Map:AddGroundObject(wolf);
npc = CreateSprite(Map, "Butterfly", 42, 18);
npc:SetCollisionMask(hoa_map.MapMode.NO_COLLISION);
@@ -657,29 +668,29 @@ function _CreateObjects()
{ "Tree Small3", 125, 96 },
-- going down - left side
- { "Tree Small3", 107, 20 },
- { "Tree Small4", 110, 23 },
- { "Tree Small3", 109, 25 },
- { "Tree Small5", 111, 28 },
- { "Tree Small3", 110, 31 },
- { "Tree Small6", 109, 34 },
- { "Tree Small3", 108, 36 },
- { "Tree Small4", 110, 39 },
- { "Tree Small3", 109, 42 },
- { "Tree Small4", 111, 45 },
- { "Tree Small3", 110, 47 },
- { "Tree Small5", 109, 50 },
- { "Tree Small3", 110, 53 },
- { "Tree Small4", 111, 56 },
- { "Tree Small3", 109, 59 },
- { "Tree Small4", 110, 62 },
- { "Tree Small3", 109, 65 },
- { "Tree Small4", 110, 67 },
- { "Tree Small3", 109, 70 },
- { "Tree Small4", 107, 73 },
- { "Tree Small3", 106, 76 },
- { "Tree Small4", 104, 79 },
- { "Tree Small3", 102, 80 },
+ { "Tree Small3", 107, 20 },
+ { "Tree Small4", 110, 23 },
+ { "Tree Small3", 109, 25 },
+ { "Tree Small5", 111, 28 },
+ { "Tree Small3", 110, 31 },
+ { "Tree Small6", 109, 34 },
+ { "Tree Small3", 108, 36 },
+ { "Tree Small4", 110, 39 },
+ { "Tree Small3", 109, 42 },
+ { "Tree Small4", 111, 45 },
+ { "Tree Small3", 110, 47 },
+ { "Tree Small5", 109, 50 },
+ { "Tree Small3", 110, 53 },
+ { "Tree Small4", 111, 56 },
+ { "Tree Small3", 109, 59 },
+ { "Tree Small4", 110, 62 },
+ { "Tree Small3", 109, 65 },
+ { "Tree Small4", 110, 67 },
+ { "Tree Small3", 109, 70 },
+ { "Tree Small4", 107, 73 },
+ { "Tree Small3", 106, 76 },
+ { "Tree Small4", 104, 79 },
+ { "Tree Small3", 102, 80 },
-- going left - bottom side
@@ -716,20 +727,20 @@ function _CreateObjects()
{ "Tree Small3", 80, 94 },
{ "Tree Small4", 78, 95 },
- -- going left - top side
- { "Tree Small3", 98, 82 },
- { "Tree Small3", 94, 81 },
- { "Tree Small4", 90, 82.5 },
- { "Tree Small3", 86, 83 },
- { "Tree Small5", 82, 82 },
- { "Tree Small3", 78, 84 },
- { "Tree Small6", 74, 85 },
-
- -- going down - top side
- { "Tree Small4", 70, 87 },
- { "Tree Small3", 68, 90 },
- { "Tree Small3", 67, 93 },
- { "Tree Small5", 66, 96 }
+ -- going left - top side
+ { "Tree Small3", 98, 82 },
+ { "Tree Small3", 94, 81 },
+ { "Tree Small4", 90, 82.5 },
+ { "Tree Small3", 86, 83 },
+ { "Tree Small5", 82, 82 },
+ { "Tree Small3", 78, 84 },
+ { "Tree Small6", 74, 85 },
+
+ -- going down - top side
+ { "Tree Small4", 70, 87 },
+ { "Tree Small3", 68, 90 },
+ { "Tree Small3", 67, 93 },
+ { "Tree Small5", 66, 96 }
}
@@ -769,8 +780,44 @@ function _CreateEvents()
local dialogue = {};
local text = {};
+ -- Map events
event = hoa_map.MapTransitionEvent("to forest NW", "dat/maps/layna_forest/layna_forest_north_west.lua", "from_layna_forest_NE");
EventManager:RegisterEvent(event);
+
+ -- generic events
+ event = hoa_map.ScriptedEvent("Map:PopState()", "Map_PopState", "");
+ EventManager:RegisterEvent(event);
+
+ -- Boss fight scene
+ event = hoa_map.ScriptedEvent("boss fight scene", "start_boss_fight_scene", "");
+ event:AddEventLinkAtEnd("boss fight pre-dialogue");
+ EventManager:RegisterEvent(event);
+
+ dialogue = hoa_map.SpriteDialogue();
+ text = hoa_system.Translate("What's that?!...");
+ dialogue:AddLineEmote(text, hero, "exclamation");
+ DialogueManager:AddDialogue(dialogue);
+ event = hoa_map.DialogueEvent("boss fight pre-dialogue", dialogue);
+ event:AddEventLinkAtEnd("Wolf runs toward the hero");
+ EventManager:RegisterEvent(event);
+
+ event = hoa_map.PathMoveSpriteEvent("Wolf runs toward the hero", wolf, hero, true);
+ event:AddEventLinkAtEnd("First Wolf battle");
+ EventManager:RegisterEvent(event);
+
+ event = hoa_map.BattleEncounterEvent("First Wolf battle");
+ event:SetMusic("mus/The_Creature_Awakens.ogg");
+ event:SetBackground("img/backdrops/battle/forest_background.png");
+ -- TODO: Add scening script
+ -- event:AddScript("");
+ event:AddEnemy(1, 0, 0); -- TODO: Add the wolf once the sprite is done.
+ event:AddEventLinkAtEnd("Make the wolf disappear");
+ event:AddEventLinkAtEnd("Map:PopState()");
+ EventManager:RegisterEvent(event);
+
+ event = hoa_map.ScriptedEvent("Make the wolf disappear", "make_wolf_invisible", "");
+ EventManager:RegisterEvent(event);
+
end
-- Create the different map zones triggering events
@@ -778,6 +825,16 @@ function _CreateZones()
-- N.B.: left, right, top, bottom
to_forest_NW_zone = hoa_map.CameraZone(0, 1, 86, 90, hoa_map.MapMode.CONTEXT_01);
Map:AddZone(to_forest_NW_zone);
+
+ to_forest_SE_zone = hoa_map.CameraZone(69, 75, 95, 96, hoa_map.MapMode.CONTEXT_01);
+ Map:AddZone(to_forest_SE_zone);
+
+ -- Fade out music zone - used to set a dramatic area
+ music_fade_out_zone = hoa_map.CameraZone(48, 50, 8, 17, hoa_map.MapMode.CONTEXT_01);
+ Map:AddZone(music_fade_out_zone);
+
+ boss_fight1_zone = hoa_map.CameraZone(103, 105, 4, 18, hoa_map.MapMode.CONTEXT_01);
+ Map:AddZone(boss_fight1_zone);
end
-- Check whether the active camera has entered a zone. To be called within Update()
@@ -785,7 +842,21 @@ function _CheckZones()
if (to_forest_NW_zone:IsCameraEntering() == true) then
hero:SetMoving(false);
EventManager:StartEvent("to forest NW");
- end
+ elseif (to_forest_SE_zone:IsCameraEntering() == true) then
+ hero:SetMoving(false);
+ EventManager:StartEvent("to forest SE");
+ elseif (music_fade_out_zone:IsCameraEntering() == true) then
+ -- fade out the music when the first boss fight hasn't been done yet.
+ if (GlobalManager:DoesEventExist("story", "layna_forest_boss_fight1") == false) then
+ AudioManager:FadeOutAllMusic(2000);
+ end
+ elseif (boss_fight1_zone:IsCameraEntering() == true) then
+ -- fade out the music when the first boss fight hasn't been done yet.
+ if (GlobalManager:DoesEventExist("story", "layna_forest_boss_fight1") == false) then
+ --GlobalManager:SetEventValue("story", "layna_forest_boss_fight1", 1);
+ EventManager:StartEvent("boss fight scene");
+ end
+ end
end
-- Sets common battle environment settings for enemy sprites
@@ -804,5 +875,23 @@ end
map_functions = {
+ Map_PopState = function()
+ Map:PopState();
+ end,
+
+ start_boss_fight_scene = function()
+ Map:PushState(hoa_map.MapMode.STATE_SCENE);
+ hero:SetMoving(false);
+ hero:SetDirection(hoa_map.MapMode.NORTH);
+ -- Play the wolf growling sound
+ AudioManager:PlaySound("snd/growl1_IFartInUrGeneralDirection_freesound.wav");
+ wolf:SetVisible(true);
+ end,
+
+ make_wolf_invisible = function()
+ wolf:SetVisible(false);
+ wolf:SetPosition(104, 3);
+ end
+
}
View
35 img/sprites/map/enemies/wolf_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 = hoa_map.MapMode.ANIM_SOUTH;
+local ANIM_NORTH = hoa_map.MapMode.ANIM_NORTH;
+local ANIM_WEST = hoa_map.MapMode.ANIM_WEST;
+local ANIM_EAST = hoa_map.MapMode.ANIM_EAST;
+
+
+sprite_animation = {
+
+ -- The file to load the frames from
+ image_filename = "img/sprites/map/enemies/wolf_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 = 6,
+ columns = 11,
+ -- The frames duration in milliseconds
+ frames = {
+ [ANIM_SOUTH] = {
+ [0] = { id = 22, duration = 150 }
+ },
+ [ANIM_NORTH] = {
+ [0] = { id = 33, duration = 150 }
+ },
+ [ANIM_WEST] = {
+ [0] = { id = 17, duration = 150 }
+ },
+ [ANIM_EAST] = {
+ [0] = { id = 8, duration = 150 }
+ }
+ }
+}
View
BIN img/sprites/map/enemies/wolf_spritesheet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
54 img/sprites/map/enemies/wolf_walk.lua
@@ -0,0 +1,54 @@
+-- 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 = hoa_map.MapMode.ANIM_SOUTH;
+local ANIM_NORTH = hoa_map.MapMode.ANIM_NORTH;
+local ANIM_WEST = hoa_map.MapMode.ANIM_WEST;
+local ANIM_EAST = hoa_map.MapMode.ANIM_EAST;
+
+sprite_animation = {
+
+ -- The file to load the frames from
+ image_filename = "img/sprites/map/enemies/wolf_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 = 6,
+ columns = 11,
+ -- The frames duration in milliseconds
+ frames = {
+ [ANIM_SOUTH] = {
+ [0] = { id = 22, duration = 100 },
+ [1] = { id = 23, duration = 100 },
+ [2] = { id = 24, duration = 100 },
+ [3] = { id = 25, duration = 100 },
+ [4] = { id = 26, duration = 100 },
+ [5] = { id = 27, duration = 100 }
+ },
+ [ANIM_NORTH] = {
+ [0] = { id = 33, duration = 100 },
+ [1] = { id = 34, duration = 100 },
+ [2] = { id = 35, duration = 100 },
+ [3] = { id = 36, duration = 100 },
+ [4] = { id = 37, duration = 100 },
+ [5] = { id = 38, duration = 100 }
+ },
+ [ANIM_WEST] = {
+ [0] = { id = 0, duration = 100 },
+ [1] = { id = 1, duration = 100 },
+ [2] = { id = 2, duration = 100 },
+ [3] = { id = 3, duration = 100 },
+ [4] = { id = 4, duration = 100 },
+ [5] = { id = 5, duration = 100 }
+ },
+ [ANIM_EAST] = {
+ [0] = { id = 11, duration = 100 },
+ [1] = { id = 12, duration = 100 },
+ [2] = { id = 13, duration = 100 },
+ [3] = { id = 14, duration = 100 },
+ [4] = { id = 15, duration = 100 },
+ [5] = { id = 16, duration = 100 }
+ }
+ }
+}
View
BIN snd/growl1_IFartInUrGeneralDirection_freesound.wav
Binary file not shown.

0 comments on commit ff93013

Please sign in to comment.
Something went wrong with that request. Please try again.