Skip to content

Commit

Permalink
Bug 736355: Add coder character
Browse files Browse the repository at this point in the history
  • Loading branch information
glecollinet committed Mar 21, 2012
1 parent 28cae24 commit d26f8d3
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 6 deletions.
Binary file added client/img/1/coder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/2/coder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/img/3/coder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions client/js/entityfactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ define(['mobs', 'items', 'npcs', 'warrior', 'chest'], function(Mobs, Items, NPCs
EntityFactory.builders[Types.Entities.VILLAGER] = function(id) {
return new NPCs.Villager(id);
};

EntityFactory.builders[Types.Entities.CODER] = function(id) {
return new NPCs.Coder(id);
};

EntityFactory.builders[Types.Entities.AGENT] = function(id) {
return new NPCs.Agent(id);
Expand Down
2 changes: 1 addition & 1 deletion client/js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT

// sprites
this.spriteNames = ["hand", "sword", "loot", "target", "talk", "sparks", "shadow16", "rat", "skeleton", "skeleton2", "spectre", "boss", "deathknight",
"ogre", "crab", "snake", "eye", "bat", "goblin", "wizard", "guard", "king", "villagegirl", "villager", "agent", "rick", "scientist", "nyan", "priest",
"ogre", "crab", "snake", "eye", "bat", "goblin", "wizard", "guard", "king", "villagegirl", "villager", "coder", "agent", "rick", "scientist", "nyan", "priest",
"sorcerer", "octocat", "beachnpc", "forestnpc", "desertnpc", "lavanpc", "clotharmor", "leatherarmor", "mailarmor",
"platearmor", "redarmor", "goldenarmor", "firefox", "death", "sword1", "axe", "chest",
"sword2", "redsword", "bluesword", "goldensword", "item-sword2", "item-axe", "item-redsword", "item-bluesword", "item-goldensword", "item-leatherarmor", "item-mailarmor",
Expand Down
10 changes: 8 additions & 2 deletions client/js/npc.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,14 @@ define(['character'], function(Character) {

"octocat": [
"Welcome to BrowserQuest!",
"Want to see the code?",
'Check out <a target="_blank" href="http://github.com/mozilla/BrowserQuest">the repository on Github</a>'
"Want to see the source code?",
'Check out <a target="_blank" href="http://github.com/mozilla/BrowserQuest">the repository on GitHub</a>'
],

"coder": [
"Welcome to BrowserQuest!",
"Want to see the source code?",
'Check out <a target="_blank" href="http://github.com/mozilla/BrowserQuest">the repository on GitHub</a>'
],

"beachnpc": [
Expand Down
6 changes: 6 additions & 0 deletions client/js/npcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ define(['npc'], function(Npc) {
this._super(id, Types.Entities.VILLAGER, 1);
}
}),

Coder: Npc.extend({
init: function(id) {
this._super(id, Types.Entities.CODER, 1);
}
}),

Scientist: Npc.extend({
init: function(id) {
Expand Down
1 change: 1 addition & 0 deletions client/js/sprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ define(['text!../sprites/agent.json',
'text!../sprites/boss.json',
'text!../sprites/chest.json',
'text!../sprites/clotharmor.json',
'text!../sprites/coder.json',
'text!../sprites/crab.json',
'text!../sprites/death.json',
'text!../sprites/deathknight.json',
Expand Down
2 changes: 1 addition & 1 deletion client/maps/world_client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/maps/world_client.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/sprites/coder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": "coder", "width": 24, "height": 24, "animations": { "idle_down": { "length": 2, "row": 0 } }, "offset_x": -4, "offset_y": -7}
Expand Down
2 changes: 1 addition & 1 deletion server/maps/world_server.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions shared/js/gametypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Types = {
FORESTNPC: 52,
DESERTNPC: 53,
LAVANPC: 54,
CODER: 55,

// Weapons
SWORD1: 60,
Expand Down Expand Up @@ -143,6 +144,7 @@ var kinds = {
guard: [Types.Entities.GUARD, "npc"],
villagegirl: [Types.Entities.VILLAGEGIRL, "npc"],
villager: [Types.Entities.VILLAGER, "npc"],
coder: [Types.Entities.CODER, "npc"],
scientist: [Types.Entities.SCIENTIST, "npc"],
priest: [Types.Entities.PRIEST, "npc"],
king: [Types.Entities.KING, "npc"],
Expand Down

0 comments on commit d26f8d3

Please sign in to comment.