Skip to content

Commit

Permalink
Merge branch 'release/0.16.1.1627'
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Sep 2, 2018
2 parents 1eb1a95 + cf06d9d commit 363021a
Show file tree
Hide file tree
Showing 29 changed files with 345 additions and 340 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Version 0.16.1.1627 - 2018-09-02 (LÖVE 11.1)

## Additions
- Added support for latin-1 charset.

## Fixes
- Fixed camera focusing on the wrong character when switching from the current to the previous character.
- Fixed faulty loading of world objects.
- Fixed faulty loading of characters.

## Other Changes
- Changed how fonts are loaded by the game to support different charsets.




# Version 0.16.0.1615 - 2018-08-30 (LÖVE 11.1)

## Additions
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# On The Roadside

[![Version](https://img.shields.io/badge/Version-0.16.0.1615-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
[![LOVE](https://img.shields.io/badge/L%C3%96VE-11.0-EA316E.svg)](http://love2d.org/)
[![Version](https://img.shields.io/badge/Version-0.16.1.1627-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
[![LOVE](https://img.shields.io/badge/L%C3%96VE-11.1-EA316E.svg)](http://love2d.org/)
[![Build Status](https://travis-ci.com/rm-code/On-The-Roadside.svg?token=q3rLXeyGTBN9VB2zsWMr&branch=develop)](https://travis-ci.com/rm-code/On-The-Roadside)

_On the Roadside_ is a turn-based strategy game in which you take control of a squad of mercenaries fighting for survival in a world shaped by unknown forces. It currently is in the very _early stages_ of development.
Expand Down
Binary file removed res/texturepacks/default/imagefont.png
Binary file not shown.
Binary file added res/texturepacks/default/imagefont_latin_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 17 additions & 5 deletions res/texturepacks/default/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ return {
}
},
font = {
source = 'imagefont.png',
glyphs = {
source = ' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü0123456789.,:;!?-+/()[]%&"\'*=_<>ß^©|',
width = 8,
height = 16
width = 8,
height = 16,
charsets = {
{
-- LATIN BASIC
-- 0020-007F (Excluded: 007F)
-- !"# $%&' ()*+ ,-./ 0123 4567 89:; <=>? @ABC DEFG HIJK LMNO PQRS TUVW XYZ[ \]^_ `abc defg hijk lmno pqrs tuvw xyz{ |}
source = 'imagefont_latin_basic.png',
glyphs = [[ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]]
},
{
-- LATIN-1
-- 00A0-00FF (Excluded: 00A0, 00AD)
-- ¡¢£¤ ¥¦§¨ ©ª«¬ ®¯°± ²³´µ ¶·¸¹ º»¼½ ¾¿ÀÁ ÂÃÄÅ ÆÇÈÉ ÊËÌÍ ÎÏÐÑ ÒÓÔÕ Ö×ØÙ ÚÛÜÝ Þßàá âãäå æçèé êëìí îïðñ òóôõ ö÷øù úûüý þÿ
source = 'imagefont_latin_1.png',
glyphs = [[¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ]]
}
}
}
}
25 changes: 15 additions & 10 deletions src/CombatState.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ function CombatState:initialize( playerFaction, savegame )
end)
end)

self.stateManager = StateManager( self.states )
self.stateManager:push( 'planning', self.factions )
self.explosionManager = ExplosionManager( self.map )

self.projectileManager = ProjectileManager( self.map )
self.projectileManager:observe( self.explosionManager )

self.sadisticAIDirector = SadisticAIDirector( self.factions, self.stateManager )
self.stateManager = StateManager( self.states )
self.stateManager:push( 'planning', self.factions, self.explosionManager, self.projectileManager )

ProjectileManager.init( self.map )
ExplosionManager.init( self.map )
self.sadisticAIDirector = SadisticAIDirector( self.factions, self.stateManager, self.explosionManager, self.projectileManager )

-- Register observations.
self.map:observe( self )
Expand Down Expand Up @@ -137,11 +139,6 @@ function CombatState:serialize()
return t
end

function CombatState:close()
ProjectileManager.clear()
ExplosionManager.clear()
end

function CombatState:keypressed( _, scancode, _ )
if self.factions:getFaction():isAIControlled() or self.stateManager:blocksInput() then
return
Expand All @@ -160,6 +157,14 @@ function CombatState:getMap()
return self.map
end

function CombatState:getExplosionManager()
return self.explosionManager
end

function CombatState:getProjectileManager()
return self.projectileManager
end

function CombatState:getFactions()
return self.factions
end
Expand Down
55 changes: 0 additions & 55 deletions src/Messenger.lua

This file was deleted.

1 change: 1 addition & 0 deletions src/characters/Character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ function Character:serialize()
local t = {
['class'] = self.creatureClass,
['name'] = self.name,
['maxActionPoints'] = self.maxActionPoints,
['actionPoints'] = self.actionPoints,
['accuracy'] = self.accuracy,
['throwingSkill'] = self.throwingSkill,
Expand Down
2 changes: 1 addition & 1 deletion src/characters/CharacterFactory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function CharacterFactory.init()
end

function CharacterFactory.loadCharacter( savedCharacter )
local character = Character( savedCharacter.class )
local character = Character( savedCharacter.class, savedCharacter.maxActionPoints )

character:setName( savedCharacter.name )
character:setActionPoints( savedCharacter.actionPoints )
Expand Down
14 changes: 9 additions & 5 deletions src/characters/Faction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,18 @@ end
-- @treturn Character The active Character.
--
function Faction:prevCharacter()
local previousCharacter = self.active:getObject()
-- Get the currently active character.
local currentCharacter = self.active:getObject()
while self.active do
-- Select the previous character or wrap around to the last character
-- in the list.
self.active = self.active:getPrev() or self.last
local character = self.active:getObject()
if not character:isDead() then

local previousCharacter = self.active:getObject()
if not previousCharacter:isDead() then
currentCharacter:deactivate()
previousCharacter:activate()
character:deactivate()
return character
return previousCharacter
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/characters/actions/RangedAttack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-- ------------------------------------------------

local Action = require( 'src.characters.actions.Action' )
local ProjectileManager = require( 'src.items.weapons.ProjectileManager' )
local ProjectileQueue = require( 'src.items.weapons.ProjectileQueue' )
local Bresenham = require( 'lib.Bresenham' )

Expand All @@ -21,8 +20,10 @@ local RangedAttack = Action:subclass( 'RangedAttack' )
-- Public Methods
-- ------------------------------------------------

function RangedAttack:initialize( character, target )
function RangedAttack:initialize( character, target, projectileManager )
Action.initialize( self, character, target, character:getWeapon():getAttackCost() )

self.projectileManager = projectileManager
end

function RangedAttack:perform()
Expand All @@ -45,8 +46,7 @@ function RangedAttack:perform()
return true
end)

local package = ProjectileQueue( self.character, ax, ay, th )
ProjectileManager.register( package )
self.projectileManager:register( ProjectileQueue( self.character, ax, ay, th ))
return true
end

Expand Down
8 changes: 4 additions & 4 deletions src/characters/actions/ThrowingAttack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-- ------------------------------------------------

local Action = require( 'src.characters.actions.Action' )
local ProjectileManager = require( 'src.items.weapons.ProjectileManager' )
local ThrownProjectileQueue = require( 'src.items.weapons.ThrownProjectileQueue' )
local Bresenham = require( 'lib.Bresenham' )

Expand All @@ -21,8 +20,10 @@ local ThrowingAttack = Action:subclass( 'ThrowingAttack' )
-- Public Methods
-- ------------------------------------------------

function ThrowingAttack:initialize( character, target )
function ThrowingAttack:initialize( character, target, projectileManager )
Action.initialize( self, character, target, character:getWeapon():getAttackCost() )

self.projectileManager = projectileManager
end

function ThrowingAttack:perform()
Expand All @@ -40,8 +41,7 @@ function ThrowingAttack:perform()
return true
end)

local package = ThrownProjectileQueue( self.character, ax, ay, th )
ProjectileManager.register( package )
self.projectileManager:register( ThrownProjectileQueue( self.character, ax, ay, th ))
return true
end

Expand Down
12 changes: 7 additions & 5 deletions src/characters/ai/SadisticAIDirector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ local SadisticAIDirector = Class( 'SadisticAIDirector' )
-- Private Methods
-- ------------------------------------------------

local function tickBehaviorTree( tree, character, states, factions )
local function tickBehaviorTree( tree, character, states, factions, projectileManager )
Log.debug( "Tick BehaviorTree for " .. tostring( character ), 'SadisticAIDirector' )
return tree:traverse( {}, character, states, factions )
return tree:traverse( {}, character, states, factions, projectileManager )
end

-- ------------------------------------------------
-- Public Methods
-- ------------------------------------------------

function SadisticAIDirector:initialize( factions, states )
function SadisticAIDirector:initialize( factions, states, explosionManager, projectileManager )
self.factions = factions
self.states = states
self.explosionManager = explosionManager
self.projectileManager = projectileManager
end

function SadisticAIDirector:update()
Expand All @@ -47,9 +49,9 @@ function SadisticAIDirector:update()
Log.debug( 'Select next character for this turn', 'SadisticAIDirector' )
local character = faction:nextCharacterForTurn()

local success = tickBehaviorTree( tree, character, self.states, self.factions )
local success = tickBehaviorTree( tree, character, self.states, self.factions, self.projectileManager )
if success then
self.states:push( 'execution', self.factions, character )
self.states:push( 'execution', self.factions, character, self.explosionManager, self.projectileManager )
return
end

Expand Down
4 changes: 2 additions & 2 deletions src/characters/ai/behaviortree/leafs/BTAttackTarget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ local BTAttackTarget = BTLeaf:subclass( 'BTAttackTarget' )
-- ------------------------------------------------

function BTAttackTarget:traverse( ... )
local blackboard, character = ...
local blackboard, character, _, _, projectileManager = ...

local success = character:enqueueAction( RangedAttack( character, blackboard.target ))
local success = character:enqueueAction( RangedAttack( character, blackboard.target, projectileManager ))
if success then
Log.debug( 'Character attacks target', 'BTAttackTarget' )
return true
Expand Down
4 changes: 2 additions & 2 deletions src/characters/ai/behaviortree/leafs/BTThrowingAttack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ local BTThrowingAttack = BTLeaf:subclass( 'BTThrowingAttack' )
-- ------------------------------------------------

function BTThrowingAttack:traverse( ... )
local blackboard, character = ...
local blackboard, character, _, _, projectileManager = ...

local success = character:enqueueAction( ThrowingAttack( character, blackboard.target ))
local success = character:enqueueAction( ThrowingAttack( character, blackboard.target, projectileManager ))
if success then
-- Store weapon id for the rearm action.
blackboard.weaponID = character:getWeapon():getID()
Expand Down
Loading

0 comments on commit 363021a

Please sign in to comment.