RuneHive-Game
Loading...
Searching...
No Matches
BotUtility.java
Go to the documentation of this file.
1package com.runehive.content.bot;
2
3import com.runehive.content.tittle.PlayerTitle;
4import com.runehive.game.world.World;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.entity.mob.player.appearance.Appearance;
7import com.runehive.game.world.entity.mob.player.appearance.Gender;
8import com.runehive.game.world.items.Item;
9import com.runehive.util.MutableNumber;
10import com.runehive.util.Utility;
11
12import java.util.*;
13
14/**
15 * Holds all the constants used by bot.
16 *
17 * @author Daniel
18 */
19public class BotUtility {
20
21 public static Map<Integer, MutableNumber> BOOT_LOOT = new HashMap<>();
22
23 public static void logLoot(Item item) {
24 MutableNumber amount = BOOT_LOOT.getOrDefault(item.getId(), new MutableNumber());
25 amount.incrementAndGet(item.getAmount());
26 BOOT_LOOT.put(item.getId(), amount);
27 }
28
29 /** List of all available bot names. */
30 public static final String[] BOT_NAMES = {
31 "Bang Bot",
32 "DJ Headshot",
33 "Kill Me",
34 "Not A Bot",
35 "Botting Betty",
36 "Wall E",
37 "S O P H I E",
38 "C H R O M P S",
39 "The Shredder",
40 "Humans DIE",
41 "Beep Boop",
42 "System Fail",
43 "Win32",
44 "Microbot",
45 "I Am Program",
46 "Bed Bath Bot",
47 "Corrupted Bot",
48 "Rouge Bot"
49 };
50
51 /** The default bot title. */
52 static final PlayerTitle TITLE = PlayerTitle.create("[BOT]", 0xC74C1C);
53
54 /** The default bot appearance. */
55 public static final Appearance APPEARANCE = new Appearance(Gender.MALE, Utility.random(0, 8), Utility.random(10, 17), Utility.random(18, 25), Utility.random(26, 31), Utility.random(33, 34), Utility.random(36, 40), Utility.random(42, 43), 7, 8, 9, 5, 0);
56
57 /** Array of all the possible fight start message. */
58 public static final String[] GEAR_UP_MESSAGES = {
59 "Time to kick ass and take names!",
60 "I am the eco cleaner and cleanse I shall!",
61 "Time to make my daddy, Daniel proud!"
62 };
63
64 /** Array of all the possible fight start message. */
65 public static final String[] FIGHT_START_MESSAGES = {
66 "Good luck",
67 "Gl",
68 "Let's see what you got"
69 };
70
71 /** Array of all the possible fight end message. */
72 public static final String[] FIGHT_END_MESSAGES = {
73 "Out gf",
74 "I'm out",
75 ""
76 };
77
78 /** Array of all the possible fight start message. */
79 public static final String[] KILLED_MESSAGES = {
80 "Too ez",
81 "Ty 4 loot bruh",
82 "Good fight",
83 "Sit",
84 "Cya",
85 "Cya in edge",
86 "Later dink"
87 };
88
89 /** Array of all the possible death message. */
90 static final String[] DEATH_MESSAGES = {
91 "Good game!",
92 "Gf",
93 "Gg",
94 "Gx",
95 "Ugh.. Developers needs to make me stronger!"
96 };
97
98 /** Generates a random bot named based on the available names. */
99 static String nameGenerator() {
101 }
102
103 /** Generates a list of all available names. */
104 private static List<String> getAvailableBotNames() {
105 List<String> names = new ArrayList<>(BOT_NAMES.length);
106 names.addAll(Arrays.asList(BOT_NAMES));
107 for (Player bot : World.getPlayers()) {
108 if (!bot.isBot) {
109 continue;
110 }
111 for (String nameList : BOT_NAMES) {
112 if (bot.getName().equalsIgnoreCase(nameList)) {
113 names.remove(nameList);
114 }
115 }
116 }
117 return names;
118 }
119
120 /** Generates a random bot type. */
121// static BotClass classGenerator() {
122// return Utility.randomElement(BotClass.values());
123// }
124}
Holds all the constants used by bot.
static final String[] FIGHT_START_MESSAGES
Array of all the possible fight start message.
static final String[] BOT_NAMES
List of all available bot names.
static final String[] FIGHT_END_MESSAGES
Array of all the possible fight end message.
static final String[] DEATH_MESSAGES
Array of all the possible death message.
static final Appearance APPEARANCE
The default bot appearance.
static final String[] GEAR_UP_MESSAGES
Array of all the possible fight start message.
static List< String > getAvailableBotNames()
Generates a list of all available names.
static void logLoot(Item item)
static Map< Integer, MutableNumber > BOOT_LOOT
static final String[] KILLED_MESSAGES
Array of all the possible fight start message.
static String nameGenerator()
Generates a random bot named based on the available names.
static final PlayerTitle TITLE
The default bot title.
static PlayerTitle create(String title, int color)
Creates a player title.
Represents the game world.
Definition World.java:46
static MobList< Player > getPlayers()
Definition World.java:544
This class represents a character controlled by a player.
Definition Player.java:125
The container class that represents an item that can be interacted with.
Definition Item.java:21
final int getId()
Gets the identification of this item.
Definition Item.java:324
final int getAmount()
Gets the quantity of this item.
Definition Item.java:342
The container class that contains functions to simplify the modification of a number.
int incrementAndGet(int amount, int maximum)
Increments the value within this counter by amount to a maximum of maximum and then returns it.
Handles miscellaneous methods.
Definition Utility.java:27
static int random(int bound)
Definition Utility.java:239
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
Definition Utility.java:248
Represents a gender for a player character.
Definition Gender.java:8