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

Commit

Permalink
fix(ai): items will now be picked up by players always..
Browse files Browse the repository at this point in the history
closes #39
  • Loading branch information
seiyria committed Dec 3, 2015
1 parent 670056a commit aea6e05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/js/rogue/definitions/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export default class Character extends Entity {

this.doBehavior('spawn');

this.behaviors = _.uniq(this.behaviors, b => b.constructor.name);

this.loadStartingEquipment();
this.loadStartingTraits(opts.template);
this.loadStartingSkills();
Expand Down
4 changes: 2 additions & 2 deletions src/js/rogue/definitions/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default class Player extends Character {

constructor(x, y, z, opts = {}) {
opts.stats = { behaviors: [
Behaviors.Attacks(),
Behaviors.Attacks(), Behaviors.Interacts(), Behaviors.PickUpItems(),
Behaviors.DropsGold('0d0'), Behaviors.HealsBelowPercent(50),
Behaviors.AlertsOnStep()
Behaviors.AlertsOnStep(), Behaviors.DropsItems()
] };
super({ key: Glyphs.Player }, x, y, z, opts);
this.factions.push(Factions.PLAYER);
Expand Down

0 comments on commit aea6e05

Please sign in to comment.