Skip to content

Commit

Permalink
完成第一个任务雏形
Browse files Browse the repository at this point in the history
增加了地点 打谷场
增加了NPC 老鼠
老村长的任务 修改为捕杀4只老鼠
  • Loading branch information
kerlw committed Feb 17, 2016
1 parent 6f04345 commit f6f4bbb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
3 changes: 2 additions & 1 deletion xinshoucun/cunzhongyang.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"no_fight" : 1
},
"exits": {
"west" : "xinshoucun/cunkou"
"west" : "xinshoucun/cunkou",
"south" : "xinshoucun/daguchang"
},
"objs" : {
"xinshoucun/npc/laocunzhang" : 1
Expand Down
10 changes: 10 additions & 0 deletions xinshoucun/daguchang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name":"打谷场",
"desc":"位于小村落南部地势较高的一处平地,被村民们用作打谷场,晾晒着各种收获,因此也招来山里的老鼠光顾,老鼠活动的痕迹简直随处可见。",
"exits": {
"north" : "xinshoucun/cunzhongyang"
},
"objs" : {
"xinshoucun/npc/rat" : 6
}
}
7 changes: 5 additions & 2 deletions xinshoucun/npc/boar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
var fm = require('framework');

var boar = fm.extend(function() {
if (!(this instanceof boar))
return new boar();

this.name = "野猪";
this.desc = ""
}, fm.NPC);
this.desc = "";
}, fm.ANIMAL);

module.exports = boar;
12 changes: 6 additions & 6 deletions xinshoucun/npc/laocunzhang.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ var laocunzhang = fm.extend(function() {
this.name = "老村长";
this.desc = ""
this.quests = {
first : {
kill_rat : {
key : "kill_rat",
target : "xingshoucun/npc/boar",
desc : "村南山脚的田地里经常有山里的野猪出没,请帮助村民们猎杀#s(HIR)$count$#e(HIR)只野猪吧。",
desc : "村子南边的打谷场上是村民们晒谷子的地方,经常有老鼠光顾,请帮助村民们捕杀$(HIR) $count$ $NOR只老鼠吧。",
type : "kill",
count : 4,
reward : {
Expand All @@ -15,7 +16,7 @@ var laocunzhang = fm.extend(function() {
}
}
}
this.add_inquiry("kill_boar", "帮助猎杀野猪", this.kill_boar_quest);
this.add_inquiry("kill_boar", "帮助捕杀老鼠", this.inquiry_kill_boar);
}, fm.NPC);

laocunzhang.prototype.visiable_inquiry = function(id, who) {
Expand All @@ -24,9 +25,8 @@ laocunzhang.prototype.visiable_inquiry = function(id, who) {
return 0;
}

laocunzhang.prototype.kill_boar_quest = function(who) {
var desc = _daemons.questd.quest_desc(this.quests['first'], who);
FUNCTIONS.message_vision("$N对$n说到:" + desc, this, who);
laocunzhang.prototype.inquiry_kill_boar = function(who) {
_daemons.questd.accept_quest(this, who, this.quests['kill_rat']);
}

module.exports = laocunzhang;
17 changes: 17 additions & 0 deletions xinshoucun/npc/rat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var fm = require('framework');

var rat = fm.extend(function() {
if (!(this instanceof rat))
return new rat();

this.name = "硕鼠";
this.desc = "肥肥胖胖的,个头超过了兔子,哪里还像一只老鼠。";

this.str = 1;
this.con = 1;
this.cor = 1;

this.setup_char();
}, fm.ANIMAL);

module.exports = rat;

0 comments on commit f6f4bbb

Please sign in to comment.