KOTH:怪物猎人


15

更新结果

介绍

为庆祝怪物猎人4终极版在新3DS上的发布(2月13日),以下是本游戏中的山丘之王。

您是新手猎人,将参加由5次连续狩猎组成的锦标赛。在这些狩猎结束时,将根据对怪物造成的伤害对猎人进行排名,当然,他们会杀死怪物还是将其杀死。此外,作为新手,您必须坚持选择的武器,直到您经验丰富为止。

词典

ATK:攻击
DEF:防御
HP :健康点
NRG:能量
GRD:后卫
SPD:速度
SHP:锐度
AGR:攻击性
POT:药水
RAT:定量
WHE:磨刀石

原理

猎人可以选择以下四种武器

              |   Id   |  ATK  |  GRD  |  SPD  |
------------------------------------------------
Great Sword   |   GS   |   7   |   2   |   2   |
Dual Blade    |   DB   |   3   |   0   |   7   |
Lance         |   LA   |   5   |   4   |   3   |
Hammer        |   HA   |   9   |   0   |   1   |

要寻找的5个怪物是:

              |   HP   |  ATK  |  DEF  |
----------------------------------------
Yian Kut-ku   |  1500  |   5   |   4   |
Rathian       |  1800  |   7   |   4   |
Rathalos      |  1800  |   4   |   7   |
Tigrex        |  2000  |   8   |   6   |
Fatalis       |  2500  |  11   |   7   |

游戏开始时,您必须选择一种武器。然后,对于5个狩猎中的每个狩猎,您将被分成4个玩家的团队,然后开始狩猎。

每个猎人的基本数据是:

              |   HP  |  NRG  |  DEF  |  SHP  |  AGR  |
-------------------------------------------------------
Hunter        |  100  |  100  |   5   |   4   |   0   |

统计数据不能超过其初始值(即,使用50HP的药水只能使您的生命恢复至100HP)。

每个猎人都以:

              |  POT  |  RAT  |  WHE  |
---------------------------------------
Hunter Items  |   5   |   5   |   5   |

控制器通过命令参数为您提供输入,您的程序必须通过stdout输出。

句法

输出(准备)
在游戏开始之前,控制器会调用您的提交且不带参数。这意味着您必须通过输出其ID来选择4种武器之一。您将保留此武器直到游戏结束。

您需要输出: WeaponID

例如:GS

输入
每次调用程序时,它将接收这种格式的参数(换行符不是输入的一部分,仅用于格式化):

Round;YourPlayerId;Monster_ATK;Monster_DEF;Monster_HP;Monster_TargetId;Monster_NextMoveId;
PlayerId_WeaponId_ATK_DEF_HP_NRG_GRD_SPD_SHP_AGR_POT_RAT_WHE_CurrentCombo;
PlayerId_WeaponId_ATK_DEF_HP_NRG_GRD_SPD_SHP_AGR_POT_RAT_WHE_CurrentCombo;
PlayerId_WeaponId_ATK_DEF_HP_NRG_GRD_SPD_SHP_AGR_POT_RAT_WHE_CurrentCombo;
PlayerId_WeaponId_ATK_DEF_HP_NRG_GRD_SPD_SHP_AGR_POT_RAT_WHE_CurrentCombo

输入示例

3;3;5;5;1164;2;S;
0_LA_5_5_75_45_4_3_2_55_5_5_5_AA;
1_HA_9_5_75_100_0_1_3_321_5_5_5_N;
2_GS_7_5_75_35_2_2_2_59_5_5_5_BB;
3_DB_3_5_75_78_0_7_2_0_5_5_5_AB

在这里,您看到这是第3分钟(从1开始),您是玩家3。您携带双刃剑,拥有3个ATK,5 DEF,75 HP,78 NRG,0 GRD,7 SPD,2 SHP,5 POT,5 RAT,5 WHE,您当前的组合是A-> B。

输出量

查看游戏玩法。

游戏玩法

每次狩猎开始时,将随机组成4个猎人的团队。如果没有足够的猎人来组队,游戏会自动添加随机选择的4个“助手”(Felyne,Melyynx,Palico或Koneko)中的1个或多个,以达到所需的数量。

每次狩猎持续50分钟,您可以每分钟执行1次操作(即,每次狩猎执行50次操作)。对于这50分钟中的每一分钟,您需要输出一个与要执行的操作相对应的字母(请参阅操作)。

猎人先走(按照开始时随机选择的顺序),然​​后怪物执行其动作(提供为Monster_NextMoveId)。所以每一分钟都是这样的:猎人1>猎人2>猎人3>猎人4>怪物>下分钟...

在第一分钟,怪物将始终使用O(请参阅动作)。动作后的每回合,怪物都会通过选择AGR价值最高的猎人来选择下一个目标。AGR每分钟减少30。

如果怪物或所有猎人被杀死,狩猎将停止。每次狩猎后,猎手都会复活,其统计信息,物品,连击和行动会重置为默认值。

猎人的行动

  • A:进攻A [需要NRG]
  • B:进攻B [需要NRG]
  • C:进攻C [需要NRG]
  • G:守卫[需要15 NRG。仅在武器的GRD> 0时使用。激活GRD伤害公式中的属性以进行下一回合。]
  • D:道奇[需要30岁NRG。完全躲避伤害,以备下一回合。]
  • W:等待[恢复30 NRG。什么都不做。]
  • T:嘲讽[恢复80 NRG。增加AGR300。]
  • P:药水[需要1 POT。恢复90 HPDEF下回合减少2。]
  • R:定量[需要1 RAT。恢复30 HP和50 NRGDEF下回合减少2。]
  • S:锐化[要求1 WHE。恢复SHP为4。减小DEF一圈。2。

怪物的行动

怪物们随机选择他们的行动。

  • O :观察(5%的机会)[什么都不做。]
  • A:攻击(40%几率)[攻击目标(在中定义Monster_TargetId)。]
  • R:咆哮(10%的机会)[使所有人震惊。猎人下一回合什么也不做。
  • F :飞行(10%几率)[下一回合完全躲避每次攻击。]
  • C:冲锋(15%几率)[攻击目标(在中定义Monster_TargetId)。下一回合完全避开每次攻击。]
  • S :旋转(20%几率)[攻击每个猎人。]

攻击与组合

每个武器可以用来发射3次型动物攻击:ABC

每次攻击都需要NRG根据以下公式进行消耗:energy = floor(100 / (SPD + 2))

赔偿金用以下公式计算:damage = ATK * (10 + SHP - DEF [- GRD])GRD仅在猎人当前守卫时才适用(请参阅操作)。当猎人使用物品时(见动作),他的DEF伤害降低2。每击中一个怪物,其伤害降低SHP1,直至最小值1。怪物的a SHP为0。对怪物造成的每次伤害均增加AGR相同的值。

如果您设法连锁攻击以创建特定的连击,则您的伤害将乘以相应的奖励。攻击以外的任何动作都会重置您当前的连击,并且使用连击reset = 1也会重置它。

              |   Combo                    | Bonus | Reset |
------------------------------------------------------------
Great Sword   | B -> B -> A                |   3   |   1   |
Great Sword   | B -> B -> B -> C           |   4   |   1   |
------------------------------------------------------------
Dual Blade    | C -> C                     |   2   |   1   |
Dual Blade    | A -> B -> A -> B           |   3   |   0   |
Dual Blade    | A -> B -> A -> B -> A      |   4   |   0   |
Dual Blade    | A -> B -> A -> B -> A -> C |   5   |   1   |
------------------------------------------------------------
Lance         | B -> B -> B                |   3   |   1   |
Lance         | A -> A -> A                |   2   |   0   |
Lance         | A -> A -> A -> C           |   4   |   1   |
------------------------------------------------------------
Hammer        | B -> B -> A                |   2   |   1   |
Hammer        | C -> C -> A                |   2   |   1   |

规则

  • 允许写入文件。请写入“ yoursubmissionname.txt”,游戏开始前该文件夹将被清空。禁止使用其他外部资源。
  • 您的提交有1秒的回复时间。
  • 提供命令以编译和运行提交。

得分与获胜

你得到 :

  • 一次成功的狩猎生存下来(怪物死亡)+1000点。
  • 在不成功的狩猎中存活下来的怪物+0点(活着的怪物)。
  • -1000点用于消逝(猎人死亡),无论狩猎结果如何。
  • 对怪物造成的每伤害+1点

获胜者是经过5次狩猎后得分最高的人。

控制者

您可以在github上找到控制器。它还包含4个用Java编写的samplebot。在Eclipse中将其打开,将已编译的bot放置在根文件夹中,然后将一个类添加到控制程序中(就像samplebots一样)。

结果

平均10场比赛:

1. Lancer: 5495
2. Felyne: 4786
3. Melynx: 4190
4. RedViper: 3886
5. Koneko: 3639
6. TheKingsJester: 3100
7. RoranStronghammer: 3046
8. WeaselWill: 2849

1个游戏的完整日志:http : //pastebin.com/bfR5ZiMJ
10个游戏的结果:http : //pastebin.com/YWFf6qT7


1
Markdown专家提示:您可以通过用两个空格终止一行来强制单个换行。不需要<br>。(相关的HTML5专业提示:没有自动关闭标签之类的东西。<br/>仅出于遗留原因才被允许,并且在语义上等同于<br>。)
Martin Ender

HP和NRG能否超过100?
captncraig 2015年

1
“坚持选择武器直到经验丰富”是什么意思?玩家每次遇到武器都可以更换武器吗?以后会有“更好”的武器吗?
rorlork

第一分钟是0还是1?
captncraig 2015年

1
@Geobits是的,我升级了游戏启动器,以便可以启动所有想要获得最终结果的游戏。我正在考虑100或1000个游戏的最终结果(在我的计算机上10个游戏大约需要15分钟)。
Thrax 2015年

Answers:


4

蓝瑟

纪律严明的战士,采用防御性格斗风格

/*jshint node:true */
'use strict';
var fs = require('fs');

var dataFile = 'lancer.txt';

function getData(callback) {
  fs.readFile(dataFile, 'utf8', function(err, contents) {
    var data = {};

    if(!err) {
      data = JSON.parse(contents);
    }

    callback(data);
  });
}

function saveData(data, callback) {
  fs.writeFile(dataFile, JSON.stringify(data), callback);
}

function parseArgs(args){
  var gameState = {
    monster: {},
    hunters: [],
    otherHunters: []
  };

  var argArray = args.split(';');

  gameState.round = +argArray.shift();
  var myId = +argArray.shift();

  gameState.monster.attack = +argArray.shift();
  gameState.monster.defense = +argArray.shift();
  gameState.monster.hp = +argArray.shift();
  var monsterTargetId = +argArray.shift();
  gameState.monster.nextMove = argArray.shift();
  gameState.monster.guard = 0;
  gameState.monster.sharpness = 0;

  for(var index = 0; index < argArray.length; index++) {
    var hunterArgs = argArray[index].split('_');
    var hunterId = +hunterArgs.shift();
    var hunter = {};
    hunter.weapon = hunterArgs.shift();
    hunter.attack = +hunterArgs.shift();
    hunter.defense = +hunterArgs.shift();
    hunter.hp = +hunterArgs.shift();
    hunter.energy = +hunterArgs.shift();
    hunter.guard = +hunterArgs.shift();
    hunter.speed = +hunterArgs.shift();
    hunter.sharpness = +hunterArgs.shift();
    hunter.aggro = +hunterArgs.shift();
    hunter.potions = +hunterArgs.shift();
    hunter.rations = +hunterArgs.shift();
    hunter.whetstones = +hunterArgs.shift();
    hunter.combo = hunterArgs.shift().split('');

    gameState.hunters.push(hunter);

    if(myId === hunterId) {
      gameState.me = hunter;
    }
    else {
      gameState.otherHunters.push(hunter);
    }

    if(monsterTargetId === hunterId) {
      gameState.monster.target = hunter;
    }
  }

  return gameState;
}

function getAttackEnergy(hunter) {
  return Math.floor(100 / (hunter.speed + 2));
}

function getDamage(attacker, defender, useGuard) {
  var guard = useGuard ? defender.guard : 0;

  return attacker.attack * (10 + attacker.sharpness - defender.defense - guard);
}

function isAttackingMe(gameState) {
  var nextMove = gameState.monster.nextMove;
  return nextMove === 'S' || (gameState.monster.target === gameState.me && (nextMove === 'A' || nextMove === 'C'));
}

function isSafeToTaunt(gameState) {
  var maxAggro = Math.max.apply(null, gameState.otherHunters.map(function(hunter){return hunter.aggro;}));
  return gameState.me.aggro + 300 < maxAggro;
}

function getAction(gameState) {
  var damage = getDamage(gameState.me, gameState.monster);
  if(gameState.me.combo.length === 2) {
    damage *= 3;
  }

  if(damage >= gameState.monster.hp && !gameState.monster.isImmune && gameState.me.energy >= getAttackEnergy(gameState.me)) {
    return 'B';
  }

  var monsterDamage = getDamage(gameState.monster, gameState.me);
  var attackingMe = isAttackingMe(gameState);

  if(monsterDamage > gameState.me.hp) {
    if(attackingMe) {
      if(gameState.me.energy >= 30) {
        return 'D';
      }

      if(monsterDamage < getDamage(gameState.monster, gameState.me, true) && gameState.me.energy >= 15) {
        return 'G';
      }      
    }

    if(gameState.me.potions > 0) {
      return 'P';
    }

    if(gameState.me.rations > 0) {
      return 'R';
    }
  }

  if(attackingMe && gameState.me.energy >= 15) {
    return 'G';
  }

  if(gameState.me.sharpness <= 1 && gameState.me.whetstones > 0 && !attackingMe) {
    return 'S';
  }

  if(gameState.me.energy >= getAttackEnergy(gameState.me) * Math.min((3 - gameState.me.combo.length), 1) && (gameState.me.combo.length < 2 || !gameState.monster.isImmune)) {
    return 'B';
  }

  if(gameState.me.energy <= 20 && isSafeToTaunt(gameState)) {
    return 'T';
  }

  if(gameState.me.rations > 0 && gameState.me.hp <= 70 && gameState.me.energy <= 50 && !attackingMe) {
    return 'R';
  }

  return 'W';
}

function startGame() {
  console.log('LA');
}

if(process.argv.length <= 2) {
  startGame();
}
else {
  var gameState = parseArgs(process.argv[2]);
  getData(function(data) {
    if(data.monsterLastAttack === 'F' || data.monsterLastAttack === 'C') {
      gameState.monster.isImmune = true;
    }
    data.monsterLastAttack = gameState.monster.nextMove;

    saveData(data, function() {
      console.log(getAction(gameState));
    });
  });
}
/*jshint node:true */
'use strict';
var fs = require('fs');

var dataFile = 'lancer.txt';

function getData(callback) {
  fs.readFile(dataFile, 'utf8', function(err, contents) {
    var data = {};

    if(!err) {
      data = JSON.parse(contents);
    }

    callback(data);
  });
}

function saveData(data, callback) {
  fs.writeFile(dataFile, JSON.stringify(data), callback);
}

function parseArgs(args){
  var gameState = {
    monster: {},
    hunters: [],
    otherHunters: []
  };

  var argArray = args.split(';');

  gameState.round = +argArray.shift();
  var myId = +argArray.shift();

  gameState.monster.attack = +argArray.shift();
  gameState.monster.defense = +argArray.shift();
  gameState.monster.hp = +argArray.shift();
  var monsterTargetId = +argArray.shift();
  gameState.monster.nextMove = argArray.shift();
  gameState.monster.guard = 0;
  gameState.monster.sharpness = 0;

  for(var index = 0; index < argArray.length; index++) {
    var hunterArgs = argArray[index].split('_');
    var hunterId = +hunterArgs.shift();
    var hunter = {};
    hunter.weapon = hunterArgs.shift();
    hunter.attack = +hunterArgs.shift();
    hunter.defense = +hunterArgs.shift();
    hunter.hp = +hunterArgs.shift();
    hunter.energy = +hunterArgs.shift();
    hunter.guard = +hunterArgs.shift();
    hunter.speed = +hunterArgs.shift();
    hunter.sharpness = +hunterArgs.shift();
    hunter.aggro = +hunterArgs.shift();
    hunter.potions = +hunterArgs.shift();
    hunter.rations = +hunterArgs.shift();
    hunter.whetstones = +hunterArgs.shift();
    hunter.combo = hunterArgs.shift().split('');

    gameState.hunters.push(hunter);

    if(myId === hunterId) {
      gameState.me = hunter;
    }
    else {
      gameState.otherHunters.push(hunter);
    }

    if(monsterTargetId === hunterId) {
      gameState.monster.target = hunter;
    }
  }

  return gameState;
}

function getAttackEnergy(hunter) {
  return Math.floor(100 / (hunter.speed + 2));
}

function getDamage(attacker, defender, useGuard) {
  var guard = useGuard ? defender.guard : 0;

  return attacker.attack * (10 + attacker.sharpness - defender.defense - guard);
}

function isAttackingMe(gameState) {
  var nextMove = gameState.monster.nextMove;
  return nextMove === 'S' || (gameState.monster.target === gameState.me && (nextMove === 'A' || nextMove === 'C'));
}

function isSafeToTaunt(gameState) {
  var maxAggro = Math.max.apply(null, gameState.otherHunters.map(function(hunter){return hunter.aggro;}));
  return gameState.me.aggro + 300 < maxAggro;
}

function getAction(gameState) {
  var damage = getDamage(gameState.me, gameState.monster);
  if(gameState.me.combo.length === 2) {
    damage *= 3;
  }

  if(damage >= gameState.monster.hp && !gameState.monster.isImmune && gameState.me.energy >= getAttackEnergy(gameState.me)) {
    return 'B';
  }

  var monsterDamage = getDamage(gameState.monster, gameState.me);
  var attackingMe = isAttackingMe(gameState);

  if(monsterDamage > gameState.me.hp) {
    if(attackingMe) {
      if(gameState.me.energy >= 30) {
        return 'D';
      }

      if(monsterDamage < getDamage(gameState.monster, gameState.me, true) && gameState.me.energy >= 15) {
        return 'G';
      }      
    }

    if(gameState.me.potions > 0) {
      return 'P';
    }

    if(gameState.me.rations > 0) {
      return 'R';
    }
  }

  if(attackingMe && gameState.me.energy >= 15) {
    return 'G';
  }

  if(gameState.me.sharpness <= 1 && gameState.me.whetstones > 0 && !attackingMe) {
    return 'S';
  }

  if(gameState.me.energy >= getAttackEnergy(gameState.me) * Math.min((3 - gameState.me.combo.length), 1) && (gameState.me.combo.length < 2 || !gameState.monster.isImmune)) {
    return 'B';
  }

  if(gameState.me.energy <= 20 && isSafeToTaunt(gameState)) {
    return 'T';
  }

  if(gameState.me.rations > 0 && gameState.me.hp <= 70 && gameState.me.energy <= 50 && !attackingMe) {
    return 'R';
  }

  return 'W';
}

function startGame() {
  console.log('LA');
}

if(process.argv.length <= 2) {
  startGame();
}
else {
  var gameState = parseArgs(process.argv[2]);
  getData(function(data) {
    if(data.monsterLastAttack === 'F' || data.monsterLastAttack === 'C') {
      gameState.monster.isImmune = true;
    }
    data.monsterLastAttack = gameState.monster.nextMove;

    saveData(data, function() {
      console.log(getAction(gameState));
    });
  });
}

另存为lancer.js,运行node lancer


1
根据RNG导致怪物表现的方式以及更重要的是团队组成,此挑战中似乎有很多变化。我已经看到此条目出现在任何地方,从指挥官到最后的死亡。使事情变得有趣。
斯宾塞

Lancer在测试游戏中表现出色!5场比赛中的3场第一。
Thrax 2015年

8

爪哇,罗兰·斯特朗哈默(Roran Stronghammer)

他挥舞着死亡之锤。

import java.util.ArrayList;
import java.util.List;


public class RoranStronghammer {

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();
    List<Hunter> otherHunters = new ArrayList<>();
    Monster monster;
    boolean canTauntSafely;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("HA");//ha!
        } else {
            System.out.println(new RoranStronghammer(args).hunt());
        }
    }

    private String hunt() {

        int requiredEnergy = 100 / (thisHunter.getSpeed() + 2);

        if (requiredEnergy > thisHunter.getEnergy()){
            if (canTauntSafely){
                return "T";
            }
            if (thisHunter.getRations() > 0){
                return "R";
            }
            return "T";
        }


        int damage = thisHunter.getAtk() * (10 + thisHunter.getSharpness() - monster.getDef());
        int monsterDamage = monster.getAtk() * (10 - thisHunter.getDef());

        String currentCombo = thisHunter.getAttacks();

        if (damage > monster.getHp()){//Kill monster if possible.
            return "B";
        }

        if (currentCombo.length() >= 2 && damage * 2 > monster.getHp()){//Kill monster if possible.
            return "A";
        }

        if (monsterDamage > thisHunter.getHp()){
            if (thisHunter.getPotions() > 0 && thisHunter.getHp() <= 10){
                return "P";
            }
            if (thisHunter.getEnergy() <= 50 && thisHunter.getRations() > 0){
                return "R";
            }
            if (thisHunter.getPotions() > 0){
                return "P";
            }
        }

        if (currentCombo.length() >= 2){
            return "A";                    //Do critical hit
        }

        if (currentCombo.length() == 0){
            if (thisHunter.getEnergy() < requiredEnergy * 3) {
                if (canTauntSafely){
                    return "T";
                }
                if (thisHunter.getRations() > 0) {
                    return "R";
                }
                return "T";
            }
            if (thisHunter.getSharpness() < 4){
                return "S";
            }
        }
        if (currentCombo.length() == 1){
            if (thisHunter.getEnergy() < requiredEnergy * 2) {
                if (canTauntSafely){
                    return "T";
                }
                if (thisHunter.getRations() > 0) {
                    return "R";
                }
                return "T";
            }
            if (thisHunter.getSharpness() < 3){
                return "S";
            }
        }
        return "B";                   //Attack constantly.

    }

    public RoranStronghammer(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        int mostAggressiveness = 0;
        int myAggressiveness = 0;

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
                myAggressiveness = hunter.getAggro();
            } else {
                otherHunters.add(hunter);
                mostAggressiveness = Math.max(mostAggressiveness, hunter.getAggro());
            }
        }

        canTauntSafely = myAggressiveness + 300 < mostAggressiveness;
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}

1
日期名称,
rofl

罗兰(Roran)似乎很想打他的命。他成功地与Yian Kut-ku战斗而死!他在我的测试游戏中排名倒数第二。
Thrax

6

黄鼠狼

我不确定我是否完全相信这个人,但是万一遇到麻烦,他的刀片很不错。

public class WeaselWill {
    int id, round, atk, def, hp,
        energy, guard, speed,
        sharp, aggro, potions,
        rations, whets;
    String combo;
    Monster monster;
    int[] aggros;

    void hunt(){
        if(willKillMe(false))
            dontDie();
        if(energy < 11){
            if(aggroDiff() > 300)
                output("T");
            output("W");
        }
        if(willHitMe()&&energy>29)
            output("D");
        int potDamage = attack(false);
        if(potDamage>monster.hp/2)
            attack(true);
        if(aggroDiff()*2>potDamage || round==1)
            attack(true);
        if(sharp==1&&whets>0&&!willKillMe(true))
            output("S");
        output("W");
    }

    int aggroDiff(){
        int highest = 0;
        for(int agg : aggros)
            highest = agg>highest?agg:highest;
        return highest - aggro;
    }

    int attack(boolean output){
        if(output)
            output("C");
        return willHitFor(combo.length()+1);
    }

    void dontDie(){
        if(energy>=30)
            output("D");
        int dmg = hitsMeFor(true);
        if(hp-dmg>-30 && rations>0)
            output("R");
        if(potions>0)
            output("P");
        if(energy>10)
            attack(true);
        output("W");
    }

    boolean willKillMe(boolean item){return willHitMe()&&(hitsMeFor(item)>=hp);}
    boolean willHitMe(){
        if(monster.move.equals("S"))
            return true;
        else if((monster.move.equals("A")||monster.move.equals("C"))&&monster.target==id)
            return true;
        return false;
    }

    int hitsMeFor(boolean item){
        return monster.atk*(10-def+(item?2:0));
    }

    int willHitFor(int combo){
        return atk*(10+sharp-monster.def)*combo;
    }

    static int atoi(String in){
        return Integer.parseInt(in);
    }

    void output(String out){
        System.out.println(out);
        System.exit(0);
    }

    public static void main(String[] args){
        if(args.length==0){
            System.out.println("DB");
        } else {
            new WeaselWill(args[0]).hunt();
        }
    }

    WeaselWill(String input){
        String[] tokens = input.split(";");
        round = atoi(tokens[0]);
        id = atoi(tokens[1]);
        monster = new Monster(new String[]{tokens[2],tokens[3],tokens[4],tokens[5],tokens[6]});        
        aggros = new int[3];
        for(int i=7,j=0;i<tokens.length;i++){
            String[] in = tokens[i].split("_");
            if(atoi(in[0])==id){
                atk = atoi(in[2]);
                def = atoi(in[3]);
                hp = atoi(in[4]);
                energy = atoi(in[5]);
                guard = atoi(in[6]);
                speed = atoi(in[7]);
                sharp = atoi(in[8]);
                aggro = atoi(in[9]);
                potions = atoi(in[10]);
                rations = atoi(in[11]);
                whets = atoi(in[12]);
                combo = in[13];                
            } else {
                aggros[j++] = atoi(in[9]);
            }
        }
    }

    class Monster{
        int atk, def, hp, target;
        String move;

        Monster(String[] in){
            atk = atoi(in[0]);
            def = atoi(in[1]);
            hp = atoi(in[2]);
            target = atoi(in[3]);
            move = in[4];
        }
    }
}

我称他为Weasel,因为当Fatalis杀死其他所有人并且他躲避到时限时,他往往得分最高。我想像一下他在出发前洗劫了尸体。
Geobits 2015年

这个家伙设法使当前的猎人几乎每次狩猎都失败!但是他的闪避确实不错!
Thrax

6

国王的小丑

怪物(尤其是法塔利斯)非常讨厌他的掷石技能。

import java.util.ArrayList;
import java.util.List;


public class TheKingsJester {

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();
    List<Hunter> otherHunters = new ArrayList<>();
    Monster monster;
    boolean canTauntSafely;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("HA");//Ha ha ha ha
        } else {
            System.out.println(new TheKingsJester(args).hunt());
        }
    }

    private String hunt() {

        String monstersNextMove = monster.getNextMove();
        boolean rest = false;

        switch (monstersNextMove){
            case "A":
            case "C":
            case "S":
                int mostAggresiveness = 0;
                for (Hunter hunter : otherHunters){
                    mostAggresiveness = Math.max(mostAggresiveness, hunter.getAggro());
                }
                if (thisHunter.getAggro() >= mostAggresiveness || monstersNextMove.equals("S")) {
                    if (thisHunter.getEnergy() >= 30){
                        return "D";
                    }
                } else if (thisHunter.getAggro() + 300 >= mostAggresiveness) {
                    rest = true;
                }
            default:
                if (thisHunter.getHp() <= 10 && thisHunter.getPotions() > 0){
                    return "P";
                }
                int monsterAttack = monster.getAtk() * 7;
                int difference = monsterAttack - thisHunter.getHp() + 1;
                if (difference > 0){
                    if (difference <= 30 && thisHunter.getRations() > 0){
                        return "R";
                    }
                    if (thisHunter.getPotions() > 0) {
                        return "P";
                    }
                    if (thisHunter.getRations() > 0){
                        return "R";
                    }
                }
                if (rest){
                    return "W";
                }
                return "T";
        }

    }

    public TheKingsJester(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        int mostAggressiveness = 0;
        int myAggressiveness = 0;

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
                myAggressiveness = hunter.getAggro();
            } else {
                otherHunters.add(hunter);
                mostAggressiveness = Math.max(mostAggressiveness, hunter.getAggro());
            }
        }

        canTauntSafely = myAggressiveness + 300 < mostAggressiveness;
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}

有趣的策略。至少《国王的小丑》分数很容易记住。
Thrax 2015年

虽然这个人的成绩似乎不太好,但我喜欢让他成为合伙人。实际上,通过保持怪物的注意力和躲避攻击,他实际上是一个不错的坦克。
Spencer

6

红毒蛇

等待合适的时机罢工。

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class RedViper {
    private static final int ENERGY_PER_GUARD = 15;
    private static final int ENERGY_PER_HIT = 20;
    private static final String FILE_PATH = "RedViper.txt";

    int round;
    int playerID;
    Hunter me;
    List<Hunter> otherHunters = new ArrayList<>();;
    Monster monster;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("LA");
        } else {
            RedViper redViper = new RedViper(args);
            String output = redViper.hunt();
            redViper.updateDataFile();
            System.out.println(output);
        }
    }

    private void updateDataFile() {
        File f = new File(FILE_PATH);
        if (f.exists())
            f.delete();
        if(monster.nextMove.equals("F") || monster.nextMove.equals("C")) {
            try {
                f.createNewFile();
            } catch (IOException e) {}
        }
    }

    private String hunt() {
        //low hp
        if (me.hp <= monster.dmg(me, false, false)) {
            if (!monster.attacksMe()) {
                if (me.potions > 0)
                    return "P";
                else if (me.rations > 0)
                    return "R";
            } else {
                if (me.hp > monster.dmg(me, true, false) && me.energy > ENERGY_PER_GUARD)
                    return "G";
                else if (me.potions > 0)
                    return "P";
                else if (me.rations > 0 && me.hp + 30 > monster.dmg(me, false, true))
                    return "R";
                else
                    return "B";
            }
        }
        if (monster.attacksMe() && me.energy >= ENERGY_PER_GUARD)
            return "G";
        if (isSafeToTaunt() && me.energy < 80)
            return "T";
        if (!monster.attacksMe() 
                && !(me.attacks.equals("BB") && me.energy >= ENERGY_PER_HIT && !monster.dodges()) 
                && !(me.attacks.equals("B") && me.energy >= ENERGY_PER_HIT*2) 
                && round < 48) {
            if (me.sharpness < 2 && me.whetstones > 0)
                return "S";
            if (me.energy <= 50 && me.hp <= 70 && me.rations > 0)
                return "R";
        }
        if ((monster.dodges() && !(me.attacks.equals("B") && me.energy >= ENERGY_PER_HIT*2)) || me.energy < ENERGY_PER_HIT)
            return "W";

        return "B";
    }

    private boolean isSafeToTaunt() {
        int highestAggro = Integer.MIN_VALUE;
        for (Hunter hunter : otherHunters) {
            if (hunter.aggro > highestAggro)
                highestAggro = hunter.aggro;
        }
        return highestAggro > me.aggro + 300;
    }

    public RedViper(String[] args) {
        List<Hunter> allHunters = new ArrayList<>();
        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);

        for (int i = 7; i < args.length; i++){
            allHunters.add(new Hunter(args[i]));
        }

        for (Hunter hunter : allHunters) {
            if (hunter.isMe()){
                me = hunter;
            } else {
                otherHunters.add(hunter);
            }
        }
    }

    private class Monster {

        int atk;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public boolean attacksMe() {
            return nextMove.equals("S") 
                    || (nextMove.equals("C") && targetId == playerID)
                    || (nextMove.equals("A") && targetId == playerID);
        }

        public int dmg(Hunter hunter, boolean guard, boolean using) {
            int damageMultiplicator = 10 - hunter.def;
            if (guard) { damageMultiplicator -= hunter.guard; }
            if (using) { damageMultiplicator += 2; }

            int damage = monster.atk * damageMultiplicator;
            return damage;
        }

        public boolean dodges() {
            File f = new File(FILE_PATH);
            return f.exists();
        }
    }

    private class Hunter {
        int id;
        int def;
        int hp;
        int energy;
        int guard;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            id = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public boolean isMe() {
            return id == playerID;
        }
    }
}

RedViper的表现不错,每次都获得第一或第二名。
Thrax

5

Java,Felyne(帮助程序)

4个示例机器人之一。这个挥舞着长矛。

import java.util.ArrayList;
import java.util.List;


public class Felyne {

    private static final int ENERGY_PER_DODGE = 30;
    private static final int ENERGY_PER_GUARD = 15;
    private static final int ENERGY_PER_WAIT = 30;
    private static final int ENERGY_PER_TAUNT = 80;
    private static final int AGGRO_PER_TAUNT = 300;

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();;
    List<Hunter> otherHunters = new ArrayList<>();;
    Monster monster;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("LA");
        } else {
            System.out.println(new Felyne(args).hunt());
        }
    }

    private String hunt() {

        if (thisHunter.getHp() <= (monster.getAtk() * 5)) {
            if (thisHunter.getPotions() > 0) 
                return "P";
            else if (thisHunter.getRations() > 0)
                return "R";
            else if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (monster.getTargetId() == playerID) {
            if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (thisHunter.getSharpness() < 2) {
            if (thisHunter.getWhetstones() > 0)
                return "S";
            else 
                return attack();
        } else {
            return attack();
        }
    }

    private String attack() {

        int energyPerHit = Math.floorDiv(100, thisHunter.getSpeed() + 2);

        // Lance Combos : AAA, AAAC, BBB
        if (thisHunter.getEnergy() >= (energyPerHit * 4) && thisHunter.getAttacks().equals("N")) 
            return "A";
        else if (thisHunter.getEnergy() <= (energyPerHit * 4) && thisHunter.getAttacks().equals("N"))
            if (100 - thisHunter.getAggro() <= ENERGY_PER_TAUNT && thisHunter.getAggro() < (otherHunters.stream().max((x, y) -> x.getAggro() - y.getAggro()).get().getAggro() + AGGRO_PER_TAUNT + 1))
                return "T";
            else
                return "W";
        else if (thisHunter.getEnergy() >= (energyPerHit * 3) && thisHunter.getAttacks().equals("A"))
            return "A";
        else if (thisHunter.getEnergy() >= (energyPerHit * 2) && thisHunter.getAttacks().equals("AA"))
            return "A";
        else if (thisHunter.getEnergy() >= (energyPerHit * 1) && thisHunter.getAttacks().equals("AAA"))
            return "C";
        else
            return "W";
    }

    public Felyne(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
            } else {
                otherHunters.add(hunter);
            }
        }
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}

因此,此示例漫游器在计分板上排名最高吗?
2015年

@justhalf现在,我的猜测是,RNG耶稣与胜利有很大关系。
Thrax 2015年

如果您怀疑RNG有很多事情要做这个,那么我认为我们可以增加捕杀的,比方说30的数量,或50
justhalf

1
@justhalf我想我会在最后一场比赛中进行100次狩猎,但在测试比赛中我只会进行10次狩猎。
Thrax

3

Java,Koneko(帮助程序)

4个示例bot之一。这个挥舞着双刃

import java.util.ArrayList;
import java.util.List;


public class Koneko {

    private static final int ENERGY_PER_DODGE = 30;
    private static final int ENERGY_PER_GUARD = 15;
    private static final int ENERGY_PER_WAIT = 30;
    private static final int ENERGY_PER_TAUNT = 80;
    private static final int AGGRO_PER_TAUNT = 300;

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();;
    List<Hunter> otherHunters = new ArrayList<>();;
    Monster monster;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("DB");
        } else {
            System.out.println(new Koneko(args).hunt());
        }
    }

    private String hunt() {

        if (thisHunter.getHp() <= (monster.getAtk() * 5)) {
            if (thisHunter.getPotions() > 0) 
                return "P";
            else if (thisHunter.getRations() > 0)
                return "R";
            else if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (monster.getTargetId() == playerID) {
            if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (thisHunter.getSharpness() < 2) {
            if (thisHunter.getWhetstones() > 0)
                return "S";
            else 
                return attack();
        } else {
            return attack();
        }
    }

    private String attack() {

        int energyPerHit = Math.floorDiv(100, thisHunter.getSpeed() + 2);

        // Dual Blade Combos : CC, ABAB, ABABA, ABABAC
        if (thisHunter.getEnergy() >= (energyPerHit * 6) && thisHunter.getAttacks().equals("N")) 
            return "A";
        else if (thisHunter.getEnergy() <= (energyPerHit * 6) && thisHunter.getAttacks().equals("N"))
            if (100 - thisHunter.getAggro() <= ENERGY_PER_TAUNT && thisHunter.getAggro() < (otherHunters.stream().max((x, y) -> x.getAggro() - y.getAggro()).get().getAggro() + AGGRO_PER_TAUNT + 1))
                return "T";
            else
                return "W";
        else if (thisHunter.getEnergy() >= (energyPerHit * 5) && thisHunter.getAttacks().equals("A"))
            return "B";
        else if (thisHunter.getEnergy() >= (energyPerHit * 4) && thisHunter.getAttacks().equals("AB"))
            return "A";
        else if (thisHunter.getEnergy() >= (energyPerHit * 3) && thisHunter.getAttacks().equals("ABA"))
            return "B";
        else if (thisHunter.getEnergy() >= (energyPerHit * 2) && thisHunter.getAttacks().equals("ABAB"))
            return "A";
        else if (thisHunter.getEnergy() >= (energyPerHit * 1) && thisHunter.getAttacks().equals("ABABA"))
            return "C";
        else
            return "W";
    }

    public Koneko(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
            } else {
                otherHunters.add(hunter);
            }
        }
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}

3

Java,Palico(帮助程序)

4个示例机器人之一。这支挥动着一把锤子。

import java.util.ArrayList;
import java.util.List;


public class Palico {

    private static final int ENERGY_PER_DODGE = 30;
    private static final int ENERGY_PER_GUARD = 15;
    private static final int ENERGY_PER_WAIT = 30;
    private static final int ENERGY_PER_TAUNT = 80;
    private static final int AGGRO_PER_TAUNT = 300;

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();;
    List<Hunter> otherHunters = new ArrayList<>();;
    Monster monster;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("HA");
        } else {
            System.out.println(new Palico(args).hunt());
        }
    }

    private String hunt() {

        if (thisHunter.getHp() <= (monster.getAtk() * 5)) {
            if (thisHunter.getPotions() > 0) 
                return "P";
            else if (thisHunter.getRations() > 0)
                return "R";
            else if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (monster.getTargetId() == playerID) {
            if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (thisHunter.getSharpness() < 2) {
            if (thisHunter.getWhetstones() > 0)
                return "S";
            else 
                return attack();
        } else {
            return attack();
        }
    }

    private String attack() {

        int energyPerHit = Math.floorDiv(100, thisHunter.getSpeed() + 2);

        // Hammer Combos : CCA, BBA
        if (thisHunter.getEnergy() >= (energyPerHit * 3) && thisHunter.getAttacks().equals("N")) 
            return "C";
        else if (thisHunter.getEnergy() <= (energyPerHit * 3) && thisHunter.getAttacks().equals("N"))
            if (100 - thisHunter.getAggro() <= ENERGY_PER_TAUNT && thisHunter.getAggro() < (otherHunters.stream().max((x, y) -> x.getAggro() - y.getAggro()).get().getAggro() + AGGRO_PER_TAUNT + 1))
                return "T";
            else
                return "W";
        else if (thisHunter.getEnergy() >= (energyPerHit * 3) && thisHunter.getAttacks().equals("C"))
            return "C";
        else if (thisHunter.getEnergy() >= (energyPerHit * 2) && thisHunter.getAttacks().equals("CC"))
            return "A";
        else
            return "W";
    }

    public Palico(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
            } else {
                otherHunters.add(hunter);
            }
        }
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}

3

Java,Melynx(帮手)

4个示例机器人之一。这把挥舞着一把伟大的剑。

import java.util.ArrayList;
import java.util.List;


public class Melynx {

    private static final int ENERGY_PER_DODGE = 30;
    private static final int ENERGY_PER_GUARD = 15;
    private static final int ENERGY_PER_WAIT = 30;
    private static final int ENERGY_PER_TAUNT = 80;
    private static final int AGGRO_PER_TAUNT = 300;

    int round;
    int playerID;
    Hunter thisHunter;
    List<Hunter> hunters = new ArrayList<>();;
    List<Hunter> otherHunters = new ArrayList<>();;
    Monster monster;

    public static void main(String[] args){
        if (args.length == 0) {
            System.out.println("GS");
        } else {
            System.out.println(new Melynx(args).hunt());
        }
    }

    private String hunt() {

        if (thisHunter.getHp() <= (monster.getAtk() * 5)) {
            if (thisHunter.getPotions() > 0) 
                return "P";
            else if (thisHunter.getRations() > 0)
                return "R";
            else if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (monster.getTargetId() == playerID) {
            if (thisHunter.getEnergy() > ENERGY_PER_GUARD)
                return "G";
            else
                return attack();
        } else if (thisHunter.getSharpness() < 2) {
            if (thisHunter.getWhetstones() > 0)
                return "S";
            else 
                return attack();
        } else {
            return attack();
        }
    }

    private String attack() {

        int energyPerHit = Math.floorDiv(100, thisHunter.getSpeed() + 2);

        // Great Sword Combos : BBA, BBBC
        if (thisHunter.getEnergy() >= (energyPerHit * 4) && thisHunter.getAttacks().equals("N")) 
            return "B";
        else if (thisHunter.getEnergy() <= (energyPerHit * 4) && thisHunter.getAttacks().equals("N"))
            if (100 - thisHunter.getAggro() <= ENERGY_PER_TAUNT && thisHunter.getAggro() < (otherHunters.stream().max((x, y) -> x.getAggro() - y.getAggro()).get().getAggro() + AGGRO_PER_TAUNT + 1))
                return "T";
            else
                return "W";
        else if (thisHunter.getEnergy() >= (energyPerHit * 3) && thisHunter.getAttacks().equals("B"))
            return "B";
        else if (thisHunter.getEnergy() >= (energyPerHit * 2) && thisHunter.getAttacks().equals("BB"))
            return "B";
        else if (thisHunter.getEnergy() >= (energyPerHit * 1) && thisHunter.getAttacks().equals("BBB"))
            return "C";
        else
            return "W";
    }

    public Melynx(String[] args) {

        args = args[0].split(";");

        round = Integer.parseInt(args[0]);
        playerID = Integer.parseInt(args[1]);
        monster = new Monster(args[2]+";"+args[3]+";"+args[4]+";"+args[5]+";"+args[6]);


        for (int i = 7; i < args.length; i++){
            hunters.add(new Hunter(args[i]));
        }

        for (Hunter hunter : hunters) {
            if (hunter.isMe()){
                thisHunter = hunter;
            } else {
                otherHunters.add(hunter);
            }
        }
    }

    private class Monster {

        int atk;
        int def;
        int hp;
        int targetId;
        String nextMove;

        public Monster(String string) {
            String[] args = string.split(";");
            atk = Integer.parseInt(args[0]);
            def = Integer.parseInt(args[1]);
            hp = Integer.parseInt(args[2]);
            targetId = Integer.parseInt(args[3]);
            nextMove = args[4];
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getTargetId() {
            return targetId;
        }

        public void setTargetId(int targetId) {
            this.targetId = targetId;
        }

        public String getNextMove() {
            return nextMove;
        }

        public void setNextMove(String nextMove) {
            this.nextMove = nextMove;
        }
    }

    private class Hunter {
        int hunterID;
        String weapon;
        int atk;
        int def;
        int hp;
        int energy;
        int guard;
        int speed;
        int sharpness;
        int aggro;
        int potions;
        int rations;
        int whetstones;
        String attacks;

        public Hunter(String string) {
            String[] args = string.split("_");
            hunterID = Integer.parseInt(args[0]);
            weapon = args[1];
            atk = Integer.parseInt(args[2]);
            def = Integer.parseInt(args[3]);
            hp = Integer.parseInt(args[4]);
            energy = Integer.parseInt(args[5]);
            guard = Integer.parseInt(args[6]);
            speed = Integer.parseInt(args[7]);
            sharpness = Integer.parseInt(args[8]);
            aggro = Integer.parseInt(args[9]);
            potions = Integer.parseInt(args[10]);
            rations = Integer.parseInt(args[11]);
            whetstones = Integer.parseInt(args[12]);
            attacks = args[13];
        }

        public int getHunterID() {
            return hunterID;
        }

        public void setHunterID(int hunterID) {
            this.hunterID = hunterID;
        }

        public String getWeapon() {
            return weapon;
        }

        public void setWeapon(String weapon) {
            this.weapon = weapon;
        }

        public int getAtk() {
            return atk;
        }

        public void setAtk(int atk) {
            this.atk = atk;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getHp() {
            return hp;
        }

        public void setHp(int hp) {
            this.hp = hp;
        }

        public int getEnergy() {
            return energy;
        }

        public void setEnergy(int energy) {
            this.energy = energy;
        }

        public int getGuard() {
            return guard;
        }

        public void setGuard(int guard) {
            this.guard = guard;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public int getSharpness() {
            return sharpness;
        }

        public void setSharpness(int sharpness) {
            this.sharpness = sharpness;
        }

        public int getAggro() {
            return aggro;
        }

        public void setAggro(int aggro) {
            this.aggro = aggro;
        }

        public int getPotions() {
            return potions;
        }

        public void setPotions(int potions) {
            this.potions = potions;
        }

        public int getRations() {
            return rations;
        }

        public void setRations(int rations) {
            this.rations = rations;
        }

        public int getWhetstones() {
            return whetstones;
        }

        public void setWhetstones(int whetstones) {
            this.whetstones = whetstones;
        }

        public String getAttacks() {
            return attacks;
        }

        public void setAttacks(String attacks) {
            this.attacks = attacks;
        }

        public boolean isMe() {
            return getHunterID() == playerID;
        }
    }
}
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.