codecombat安息之云山峰41关代码分享
来源:互联网 发布:订货会软件 编辑:程序博客网 时间:2024/04/26 19:15
codecombat中国游戏网址:http://www.codecombat.cn/
所有代码为javascript代码分享
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41、Summit's Gate
//需要一个好的操作
// Fight your way into the Inner Sanctum of the ogre chieftain, and kill her.
this.flags = function(){
var flagg = this.findFlag("green");
var flagb = this.findFlag("black");
if (flagg) {
this.pickUpFlag(flagg);
}
if (flagb) {
this.jumpTo(flagb.pos);
this.pickUpFlag(flagb);
}
};
this.attacks = function(){
var enemy = this.findNearest(this.findEnemies());
if (enemy && this.distanceTo(enemy) < 10) {
if (this.isReady("bash")) {
this.bash(enemy);
}
else if (this.isReady("throw")) {
this.throw(enemy);
}
else {
this.attack(enemy);
}
}
};
this.builds = function(){
if (this.gold > this.costOf("archer")) {
this.summon("archer");
}
};
this.comm = function(friend){
if (friend) {
var enemy = friend.findNearestEnemy();
if (friend.type == "paladin" && this.health < this.maxHealth) {
this.command(friend, "cast", "heal", this);
}
else if (enemy && enemy.type != "tower") {
this.command(friend, "attack", enemy);
}
else {
if (friend.pos.x < 240) {
this.command(friend, "move", {x:friend.pos.x+1,y:28});
}
}
}
};
this.commandFriends = function() {
// Command your friends.
var friends = this.findFriends();
for(var i=0; i < friends.length; i++) {
var friend = friends[i];
if(friend.type == "paladin") {
this.comm(friend);
}
else if (friend.type == "archer") {
this.comm(friend);
}
else if (friend.type == "soldier") {
this.comm(friend);
}
}
};
loop {
this.flags();
this.builds();
this.attacks();
this.commandFriends();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
所有代码为javascript代码分享
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41、Summit's Gate
//需要一个好的操作
// Fight your way into the Inner Sanctum of the ogre chieftain, and kill her.
this.flags = function(){
var flagg = this.findFlag("green");
var flagb = this.findFlag("black");
if (flagg) {
this.pickUpFlag(flagg);
}
if (flagb) {
this.jumpTo(flagb.pos);
this.pickUpFlag(flagb);
}
};
this.attacks = function(){
var enemy = this.findNearest(this.findEnemies());
if (enemy && this.distanceTo(enemy) < 10) {
if (this.isReady("bash")) {
this.bash(enemy);
}
else if (this.isReady("throw")) {
this.throw(enemy);
}
else {
this.attack(enemy);
}
}
};
this.builds = function(){
if (this.gold > this.costOf("archer")) {
this.summon("archer");
}
};
this.comm = function(friend){
if (friend) {
var enemy = friend.findNearestEnemy();
if (friend.type == "paladin" && this.health < this.maxHealth) {
this.command(friend, "cast", "heal", this);
}
else if (enemy && enemy.type != "tower") {
this.command(friend, "attack", enemy);
}
else {
if (friend.pos.x < 240) {
this.command(friend, "move", {x:friend.pos.x+1,y:28});
}
}
}
};
this.commandFriends = function() {
// Command your friends.
var friends = this.findFriends();
for(var i=0; i < friends.length; i++) {
var friend = friends[i];
if(friend.type == "paladin") {
this.comm(friend);
}
else if (friend.type == "archer") {
this.comm(friend);
}
else if (friend.type == "soldier") {
this.comm(friend);
}
}
};
loop {
this.flags();
this.builds();
this.attacks();
this.commandFriends();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 0
- codecombat安息之云山峰41关代码分享
- codecombat安息之云山峰22-31关代码分享
- codecombat安息之云山峰1-10关及森林47/48关代码分享
- codecombat安息之云山峰11-21关及沙漠38关代码分享
- codecombat安息之云山峰32-36关及森林49关代码分享
- codecombat安息之云山峰37-40及地牢42关代码分享
- codecombat之边远地区的森林23-30关及地牢40\41关代码分享
- codecombat之KithGard地牢1-18关代码分享
- codecombat之KithGard地牢19-37关代码分享
- codecombat之Sarven沙漠1-12关代码分享
- codecombat之Sarven沙漠25-37关代码分享
- codecombat之边远地区的森林1-11关及地牢38关代码分享
- codecombat之边远地区的森林12-22关及地牢39关代码分享
- codecombat之Sarven沙漠13-24关及森林45/46关代码分享
- codecombat之边远地区的森林31-44关代码分享
- 分享codecombat游戏第一章关卡精通代码JavaScript
- CodeCombat
- 山峰
- mysql sql优化
- JRE,JDK和JVM的区别
- 只有0和1的数
- 使用request.getParameter()读取参数时出现的中文乱码现象
- linux上nginx配置https服务
- codecombat安息之云山峰41关代码分享
- Lucas定理+中国剩余定理 hdu5446 Unknown Treasure
- CentOS6.4下Mysql数据库的安装与配置
- 网络操作系统和分布式操作系统的区别
- C语言的内存管理技术
- Ubuntu 14.04 LTS 下 APACHE 支持 ASP.NET MVC5
- 我在hp的第一次JavaWeb总结
- Linux中批量删除redis中的key
- java线程系列---Runnable和Thread的区别