Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:seiyria/Roguathia
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Dec 2, 2015
2 parents 6a8d064 + 967da8e commit 605ed41
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 13 deletions.
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
<a name="0.2.4"></a>
## [0.2.4](https://github.com/seiyria/Roguathia/compare/0.2.4...v0.2.4) (2015-12-02)
<a name="0.2.6"></a>
## [0.2.6](https://github.com/seiyria/Roguathia/compare/0.2.6...v0.2.6) (2015-12-02)




<a name="0.2.6"></a>
## [0.2.6](https://github.com/seiyria/Roguathia/compare/0.2.5...0.2.6) (2015-12-02)


### Bug Fixes

* **death:** monsters that previously could have died to undefined will have an appropriate k ([412345f](https://github.com/seiyria/Roguathia/commit/412345f)), closes [#25](https://github.com/seiyria/Roguathia/issues/25)
* **game:** default unlocked data is also unlocked by default and does not require repurchas ([7d712f6](https://github.com/seiyria/Roguathia/commit/7d712f6)), closes [#23](https://github.com/seiyria/Roguathia/issues/23)
* **ui:** the correct number of slots taken is now displayed ([4ec8ba2](https://github.com/seiyria/Roguathia/commit/4ec8ba2)), closes [#21](https://github.com/seiyria/Roguathia/issues/21)
* **ui:** upgrade currency is now entirely uppercase to match convention of the rest of th ([a675209](https://github.com/seiyria/Roguathia/commit/a675209)), closes [#34](https://github.com/seiyria/Roguathia/issues/34)



<a name="0.2.5"></a>
## [0.2.5](https://github.com/seiyria/Roguathia/compare/0.2.4...0.2.5) (2015-12-02)


### Features

* **game:** sp/kp are cached while the game runs now and will be added upon restart if the g ([e0559d5](https://github.com/seiyria/Roguathia/commit/e0559d5)), closes [#37](https://github.com/seiyria/Roguathia/issues/37)



Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Roguathia",
"version": "0.2.4",
"version": "0.2.6",
"authors": [
"Kyle Kemp <kyle@seiyria.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A small roguelike.",
"readme": "README.md",
"repository": "https://github.com/seiyria/Roguathia",
"version": "0.2.4",
"version": "0.2.6",
"license": "MIT",
"authors": [
"Kyle Kemp <kyle@seiyria.com>"
Expand Down
2 changes: 1 addition & 1 deletion src/jade/templates/party-tab.jade
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ script(type="text/ng-template", id="player-skills")
script(type="text/ng-template", id="player-equipment")
.row.text-center Equipment
.row(ng-repeat="(slotName, count) in player.raceInst.slots")
.col-xs-12.slot-name > {{_.capitalize(slotName)}} ({{player.equipment[slotName].length || 0}}/{{count}} slots used)
.col-xs-12.slot-name > {{_.capitalize(slotName)}} ({{ countSlotsTaken(player.equipment[slotName]) }}/{{count}} slots used)
.col-xs-12(ng-repeat="item in player.equipment[slotName]", ng-include="'player-item'")

script(type="text/ng-template", id="player-inventory")
Expand Down
2 changes: 1 addition & 1 deletion src/jade/templates/upgrades.jade
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ script(type="text/ng-template", id="upgrades")
script(type="text/ng-template", id="upgrade-block")
.col-xs-12(uib-tooltip="{{upgrade.help}}", tooltip-placement="right", tooltip-append-to-body="true") {{upgrade.name}}
.col-xs-6
span {{upgrade.cost | number:0}} {{upgrade.currency}}
span {{upgrade.cost | number:0}} {{upgrade.currency | uppercase}}
.col-xs-6
button.btn.btn-link.margin-0(ng-disabled="currencyDataManager.currency[upgrade.currency] < upgrade.cost", ng-click="buyUpgrade(upgrade)") Buy
2 changes: 2 additions & 0 deletions src/js/angular/controllers/Party.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module.controller('Party', ($scope, $uibModal) => {

$scope.inventoryOffset = () => 60 + document.getElementsByClassName('player-block')[0].offsetHeight;

$scope.countSlotsTaken = (equipment) => _.reduce(equipment, (prev, item) => prev + item.slotsTaken, 0);

$scope.openEditWindow = (player, index) => {
$uibModal.open({
templateUrl: 'player-edit',
Expand Down
33 changes: 28 additions & 5 deletions src/js/angular/controllers/Upgrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.filter('visibleUpgrades', (CurrencyDataManager, UpgradeDataManager) => {
};
});

module.controller('Upgrades', ($scope, CurrencyDataManager, UpgradeDataManager, TemplateDataManager) => {
module.controller('Upgrades', ($scope, $localStorage, CurrencyDataManager, UpgradeDataManager, TemplateDataManager) => {

$scope.upgrades = Upgrades;
$scope.upgradeDataManager = UpgradeDataManager;
Expand All @@ -32,6 +32,11 @@ module.controller('Upgrades', ($scope, CurrencyDataManager, UpgradeDataManager,
const rebuildUpgrades = () => {
const newState = curState = NewState();

_.each(newState.unlocked.race.concat(newState.unlocked.profession), random => {
if(_.contains(UpgradeDataManager.upgrades, `Random: ${random}`)) return;
UpgradeDataManager.upgrades.push(`Random: ${random}`);
});

_.each(UpgradeDataManager.upgrades, name => {
const upgrade = _.findWhere(Upgrades, { name });
if(upgrade && upgrade.operate) upgrade.operate(newState);
Expand All @@ -42,14 +47,32 @@ module.controller('Upgrades', ($scope, CurrencyDataManager, UpgradeDataManager,
SetState(newState);
};

const getCurrencyFrom = (store) => {
_.each(['sp', 'kp', 'vp'], key => {
const add = store[`${key}Earned`] || 0;
CurrencyDataManager.addCurrency(key, add);
});
};

if($localStorage.saveStateCache) {
getCurrencyFrom($localStorage.saveStateCache);
$localStorage.saveStateCache = null;
}

rebuildUpgrades();
StartGameCycle();

GameState.on('redraw', () => {
$localStorage.saveStateCache = {
spEarned: GameState.spEarned,
kpEarned: GameState.kpEarned
};
});

GameState.on('gameover', () => {
_.each(['sp', 'kp', 'vp'], key => {
const add = GameState[`${key}Earned`] || 0;
CurrencyDataManager.addCurrency(key, add);
});
getCurrencyFrom(GameState);

$localStorage.saveStateCache = null;

rebuildUpgrades();

Expand Down
2 changes: 1 addition & 1 deletion src/js/rogue/content/behaviors/death.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class KillsSelfAfterPeriodOfTimeBehavior extends Behavior {
}
act(me) {
if(this.turns-- > 0) return;
me.die('time');
me.die({ name: 'time' });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/rogue/worldgen/monster-spawner.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class MonsterSpawner {
const firstBadMonster = _.find(GameState.monsters, mon => !mon.important);

// clean up old monsters
firstBadMonster.die(`Selyk's Divine Hand`);
firstBadMonster.die({ name: `Selyk's Divine Hand` });
}

const monster = Monsters[monsterName];
Expand Down

0 comments on commit 605ed41

Please sign in to comment.