KOTH: Monster Hunter


15

Hasil yang Diperbarui

pengantar

Untuk merayakan peluncuran Monster Hunter 4 Ultimate pada 3DS baru (13 Februari), inilah King of the Hill yang bertema pada game ini.

Anda adalah pemburu pemula, yang akan mengambil bagian dalam turnamen yang terdiri dari 5 perburuan eksekutif. Pada akhir perburuan ini, pemburu akan diberi peringkat tergantung pada kerusakan yang mereka hadapi terhadap monster dan tentu saja apakah mereka membunuhnya atau dikalahkan olehnya. Juga, sebagai pemula, Anda harus tetap menggunakan senjata yang Anda pilih sampai Anda lebih berpengalaman.

Kamus

ATK: Serangan
DEF: Pertahanan
HP : Poin Kesehatan
NRG: Energi
GRD: Penjaga
SPD: Kecepatan
SHP: Ketajaman
AGR: Agresivitas
POT: Ramuan
RAT: Ransum
WHE: Batu Asahan

Prinsip

Pemburu dapat memilih di antara berbagai 4 senjata :

              |   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   |

The 5 monster untuk berburu adalah:

              |   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   |

Ketika permainan dimulai, Anda harus memilih senjata. Kemudian, untuk masing-masing dari 5 perburuan, Anda akan dibagi di antara tim yang terdiri dari 4 pemain dan Anda akan mulai berburu.

Setiap statistik dasar pemburu adalah:

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

Statistik tidak dapat melampaui nilai awal mereka (yaitu minum ramuan dengan 50HP hanya mengembalikan kesehatan Anda hingga 100HP).

Setiap pemburu dimulai dengan:

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

Kontroler memberi Anda input melalui argumen perintah, program Anda harus output melalui stdout.

Sintaksis

Keluaran (persiapan)
Sebelum permainan dimulai, pengontrol akan meminta Anda untuk mengirimkan tanpa argumen. Ini berarti Anda harus memilih salah satu dari 4 senjata dengan mengeluarkan ID-nya. Anda akan menyimpan senjata ini sampai akhir permainan.

Anda perlu menampilkan: WeaponID

Sebagai contoh: GS.

Input
Setiap kali program Anda dipanggil, ia akan menerima argumen dalam format ini (baris baru bukan bagian dari input yang hanya digunakan untuk memformat):

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

Contoh input

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

Di sini, Anda melihat itu adalah menit ke-3 (dimulai pada 1) dan Anda adalah pemain 3. Anda membawa Dual Blades, Anda memiliki 3 ATK, 5 DEF, 75 HP, 78 NRG, 0 GRD, 7 SPD, 2 SHP, 5 POT, 5 RAT, 5 KAPAN dan kombo Anda saat ini adalah A-> B.

Keluaran

Lihat gameplay.

Gameplay

Tim dari 4 pemburu dibuat secara acak pada awal setiap perburuan. Jika tidak ada cukup banyak pemburu untuk membuat tim, permainan akan secara otomatis menambahkan 1 atau lebih dari "pembantu" (Felyne, Melynx, Palico atau Koneko) yang dipilih secara acak untuk mencapai angka yang diinginkan.

Setiap perburuan berlangsung 50 menit , dan Anda dapat mengambil 1 tindakan per menit (yaitu 50 aksi per berburu). Untuk masing-masing 50 menit ini, Anda harus mengeluarkan surat yang sesuai dengan tindakan yang akan Anda ambil (lihat tindakan).

Pemburu pergi dulu (dalam urutan acak yang dipilih di awal), kemudian monster mengeksekusi aksinya (yang disediakan sebagai Monster_NextMoveId). Jadi setiap menit berjalan seperti ini: Hunter 1> Hunter 2> Hunter 3> Hunter 4> Monster> Menit berikutnya ...

Pada menit pertama, monster itu akan selalu menggunakan O(lihat aksi). Setiap belokan setelah aksinya, monster akan memilih target berikutnya dengan memilih pemburu dengan nilai tertinggi AGR. AGRberkurang 30 per menit.

Jika monster atau semua pemburu terbunuh, perburuan berhenti. Para pemburu dihidupkan kembali setelah setiap perburuan, dan statistik, item, kombo dan tindakan mereka diatur ulang ke nilai default mereka.

Tindakan pemburu

  • A: Attack A [Membutuhkan NRG]
  • B: Attack B [Membutuhkan NRG]
  • C: Attack C [Membutuhkan NRG]
  • G: Guard [Membutuhkan 15 NRG. Hanya dapat digunakan jika senjata memiliki GRD> 0. Mengaktifkan GRDstat dalam formula kerusakan untuk giliran selanjutnya.]
  • D: Dodge [Membutuhkan 30 NRG. Menghindari kerusakan total untuk belokan berikutnya.]
  • W: Tunggu [Pulihkan 30 NRG. Tidak melakukan apa-apa lagi.]
  • T: Taunt [Restore 80 NRG. MeningkatAGR 300.]
  • P: Potion [Membutuhkan 1 POT. Pulihkan 90 HP. MengurangiDEF 2 untuk giliran berikutnya.]
  • R: Ration [Membutuhkan 1 RAT. Pulihkan 30 HPDAN 50 NRG. MengurangiDEF 2 untuk giliran berikutnya.]
  • S: Sharpen [Membutuhkan 1 WHE. Kembalikan SHPke 4. Dikurangi DEFoleh 2 untuk giliran berikutnya.]

Tindakan monster

Monster memilih aksi mereka secara acak.

  • O : Amati (peluang 5%) [Tidak melakukan apa-apa.]
  • A: Serang (peluang 40%) [Menyerang target (didefinisikan dalam Monster_TargetId).]
  • R: Roar (kemungkinan 10%) [Stuns everyone. Pemburu tidak melakukan perubahan selanjutnya.]
  • F : Terbang (peluang 10%) [Sepenuhnya menghindar setiap serangan di giliran berikutnya.]
  • C: Mengisi daya (peluang 15%) [Menyerang target (didefinisikan dalam Monster_TargetId). Benar-benar menghindari setiap serangan giliran berikutnya.]
  • S : Putar (peluang 20%) [Menyerang setiap pemburu.]

Serangan & Kombo

Setiap senjata dapat digunakan untuk meluncurkan 3 serangan differents: A, Bdan C.

Setiap serangan membutuhkan dan mengkonsumsi NRG sesuai dengan rumus ini:energy = floor(100 / (SPD + 2))

Kerusakan dihitung dengan rumus ini: damage = ATK * (10 + SHP - DEF [- GRD]). GRDhanya diterapkan jika pemburu saat ini sedang menjaga (lihat aksi). Ketika seorang pemburu menggunakan item (lihat aksi), DEFitu berkurang sebesar 2. Setiap hit pada monster berkurang SHP1 hingga minimum 1. Monster memiliki SHP0. 0. Setiap damage yang ditimbulkan pada monster bertambah AGRdengan nilai yang sama.

Jika Anda berhasil membuat serangan berantai untuk membuat kombo tertentu, kerusakan Anda akan dikalikan dengan bonus yang sesuai. Tindakan apa pun selain serangan akan menyetel ulang kombo Anda saat ini, dan kombo dengan reset = 1juga akan meresetnya.

              |   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   |

Aturan

  • Menulis ke file diperbolehkan. Silakan menulis ke "milikmu pengirimanmu.txt", folder akan dikosongkan sebelum permainan dimulai. Sumber daya eksternal lainnya tidak diizinkan.
  • Kiriman Anda memiliki 1 detik untuk merespons.
  • Berikan perintah untuk mengkompilasi dan menjalankan kiriman Anda.

Mencetak & Menang

Anda mendapatkan :

  • +1000 poin untuk selamat dari perburuan yang berhasil (monster monster mati).
  • +0 poin untuk selamat dari perburuan yang gagal (monster hidup).
  • -1000 poin untuk meninggal dunia (pemburu mati) tidak peduli hasil perburuannya.
  • +1 poin per kerusakan yang diberikan kepada monster

Pemenang adalah yang memiliki skor tertinggi setelah 5 perburuan.

Pengendali

Anda dapat menemukan pengontrol di github. Ini juga mengandung 4 samplebot, ditulis dalam Java. Buka di Eclipse, tempatkan bot yang dikompilasi di folder root dan tambahkan kelas ke program kontrol (sama seperti samplebots).

Hasil

Rata-rata 10 pertandingan:

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

Log lengkap dari 1 game: http://pastebin.com/bfR5ZiMJ
Hasil dari 10 game: http://pastebin.com/YWFf6qT7


1
Pro-tip penurunan harga: Anda dapat memaksa satu baris istirahat dengan mengakhiri garis dengan dua ruang. Tidak perlu <br>. (Terkait pro-tip HTML5: tidak ada tag penutup sendiri. <br/>Hanya diizinkan untuk alasan lawas dan secara semantik setara dengan <br>).
Martin Ender

Bisakah HP dan NRG melampaui 100?
captncraig

1
Apa artinya "tetap pada senjata yang Anda pilih sampai Anda lebih berpengalaman"? dapatkah pemain mengubah senjata di setiap pertemuan? apakah nantinya akan ada senjata "yang lebih baik"?
rorlork

Apakah menit pertama 0 atau 1?
captncraig

1
@ Geobits Ya, saya meningkatkan peluncur game saya sehingga saya dapat memulai sebanyak mungkin permainan yang saya inginkan untuk mendapatkan hasil akhir. Saya memikirkan 100 atau 1000 game untuk hasil akhir (10 game membutuhkan waktu sekitar 15 menit di komputer saya).
Thrax

Jawaban:


4

Lancer

Seorang prajurit yang disiplin yang menggunakan gaya bertarung defensif

/*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));
    });
  });
}

Simpan sebagai lancer.js, jalankan dengannode lancer


1
Tampaknya ada banyak variasi dalam tantangan ini tergantung pada bagaimana RNG menyebabkan monster berperilaku dan, yang lebih penting, susunan tim. Saya telah melihat entri ini masuk di mana saja dari pimpinan memerintah sampai mati terakhir. Membuat hal-hal menarik.
Spencer

Lancer melakukannya dengan sangat baik di game uji! Pertama dalam 3 dari 5 game.
Thrax

8

Jawa, Roran Stronghammer

Dia memegang palu kematian.

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
Nama
dat

Roran sepertinya suka memukul tanpa terlalu peduli dengan hidupnya. Dia berhasil mati melawan Yian Kut-ku! Dia datang terakhir dalam game uji saya.
Thrax

6

Musang Will

Saya tidak yakin saya sepenuhnya mempercayai orang ini, tetapi bilahnya bagus jika ada masalah.

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];
        }
    }
}

Saya memanggilnya Weasel karena dia cenderung mendapat skor terbaik ketika Fatalis membunuh semua orang dan dia menghindar sampai batas waktu. Saya suka membayangkan dia menjarah mayat-mayat sebelum keluar.
Geobits

Orang ini berhasil membuat pemburu saat ini gagal hampir setiap perburuan! Tapi dia menghindar dengan cukup baik!
Thrax

6

Sang Raja Jester

Para monster (terutama Fatalis) sangat tidak menyukai keterampilan melempar batu.

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;
        }
    }
}

Strategi yang menarik. Setidaknya skor The King's Jester adalah angka yang mudah diingat.
Thrax

Meskipun yang ini tampaknya tidak mendapat nilai yang baik, saya suka menjadikannya sebagai mitra. Dia benar-benar membuat tank yang cukup bagus dengan menjaga perhatian monster dan menghindari serangan.
Spencer

6

RedViper

Menunggu momen yang tepat untuk menyerang.

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 berjalan cukup baik, ia berakhir di posisi ke-1 atau ke-2 setiap kali.
Thrax

5

Java, Felyne (helper)

Salah satu dari 4 contoh bot. Yang ini menggunakan Lance.

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;
        }
    }
}

Jadi bot sampel ini berada di puncak papan skor?
justhalf

@ justhalf Untuk saat ini, dan tebakan saya adalah RNG Yesus memiliki banyak hubungannya dengan kemenangannya.
Thrax

Jika Anda curiga RNG ada hubungannya dengan ini, maka saya pikir kita dapat meningkatkan jumlah perburuan, katakanlah, 30 atau 50.
justhalf

1
@ justhalf Saya pikir saya akan melakukan 100 perburuan untuk pertandingan terakhir, tetapi saya hanya akan melakukan 10 untuk pertandingan uji.
Thrax

3

Jawa, Koneko (penolong)

Salah satu dari 4 contoh bot. Yang ini menggunakan Dual Blades

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

Jawa, Palico (penolong)

Salah satu dari 4 contoh bot. Yang ini menggunakan Hammer.

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 (helper)

Salah satu dari 4 contoh bot. Yang ini menggunakan Pedang Hebat.

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;
        }
    }
}
Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.