| 18 | | . it has !start command which uses *scorereset, *shipreset, !random2 and *lock 's commands before start. |
| 19 | | . each ER+ has to *arena GO GO GO after the timertask(10 seconds) |
| 20 | | . command to set terr is !terr name is before the !start command |
| 21 | | . command to switch terr is !terr name1 newTerr is after !start command |
| | 21 | . it has !start command which uses *scorereset, *shipreset and *lock 's commands before start. |
| | 22 | . each ER+ has to MANUALLY *arena GO GO GO after the timertask(10 seconds) |
| | 23 | . command to set everyone as a ship is !ship (old !setship) |
| | 24 | . command to set terr is !terr name |
| | 25 | . command to switch terr is !switch name:newTerr |
| 39 | | "This is a guide to any turretwar hosting", |
| 40 | | "1.!start command WILL: *SCORERESET, *SHIPRESET, *LOCK and !random 2(CREATES 2 TEAMS)", |
| 41 | | "2.You can host it with SHIP promotions or Not - use '!prom' to enable it", |
| 42 | | "3.Use !setship #ship if you're not using promotion, it will set EVERYONE into a ship.", |
| 43 | | "4.You should set two terrs BEFORE game starts - use '!terr <name>' to pick each terr", |
| 44 | | "5.You can switch terrs while the game is RUNNING - use '!terr <player1> <newTERR> <#ShipPlayer1>' to switch", |
| 45 | | "6.If you're using promotion, then just !terr <player1> <newTERR> to switch", |
| 46 | | "7.You can set warp on, so when someone DETACHES a terr, he gets warped - use !warp to enable warpback", |
| 47 | | "8.Use !setupwarplist and check what command warps freqs into safes.", |
| 48 | | "9.Use !stop to stop the game - it will UNLOCK arena and stop the game." |
| | 52 | "1. Use !terr name to pick terr", |
| | 53 | "2. Use !switch name:newTerr to switch terrs", |
| | 54 | "3. Use !prom ship:kills to set a promotion", |
| | 55 | "4. Use !ship number to set everyone in this ship", |
| | 56 | "5. Use !start to: scorereset, shipreset and lock", |
| | 57 | "6. Use !warp to make detachers get warped to spawn area - old !warpon command ", |
| | 58 | "7. do manually the *arena GO GO GO and *timer <numberMinutes>", |
| | 59 | "8. Use !setship #ship to set the starter ship (using promotions or not)", |
| | 60 | "9. Use !setupwarplist to check the warp command", |
| | 61 | "10. When you use !terr name at first time, it'll automatically !random 2, so don't worry about the old !random 2", |
| | 62 | "11. !prom ship:kills is AUTO-SORTED by KILLS in the LIST !lprom" |
| 98 | | m_botAction.setShip(name, 7); |
| 99 | | m_botAction.sendArenaMessage(name+" got promoted to lancaster, get 45 kills to next promotion!", 2); |
| | 129 | if(kills >= e.getKill()) //this is to the last ship promotion(the last limit of kills) |
| | 130 | if(!m_botAction.getPlayer(name).isShip(e.getShip())) |
| | 131 | { |
| | 132 | m_botAction.setShip(name, e.getShip()); |
| | 133 | m_botAction.sendArenaMessage(name+" is owning! He just got promoted to "+e.getShipName()+"!", 7); |
| | 134 | } |
| 101 | | else if(kills == 45) |
| 102 | | { |
| 103 | | m_botAction.setShip(name, 2); |
| 104 | | m_botAction.sendArenaMessage(name+" got promoted to javelin, get 60 kills to next promotion!", 2); |
| 105 | | } |
| 106 | | else if(kills == 60) |
| 107 | | { |
| 108 | | m_botAction.setShip(name, 1); |
| 109 | | m_botAction.sendArenaMessage(name+" is owning! He just got promoted to warbird!", 2); |
| 110 | | } |
| 111 | | } |
| | 136 | |
| | 137 | else if(kills >= e.getKill() && kills < listShipSettings.get(i+1).getKill())//to any other promotion(needs 2 limits of kills) |
| | 138 | if(!m_botAction.getPlayer(name).isShip(e.getShip())) |
| | 139 | { |
| | 140 | m_botAction.setShip(name, e.getShip()); |
| | 141 | m_botAction.sendArenaMessage(name+" got promoted to "+e.getShipName()+"!", 21); |
| | 142 | } |
| | 143 | } |
| | 144 | } |
| | 145 | |
| | 146 | public void setFirstShip(String name, String message) |
| | 147 | { |
| | 148 | if(!freq1Terr && !freq0Terr) |
| | 149 | {//!ship 3 |
| | 150 | this.firstShip = Integer.parseInt( message.substring(6) ); |
| | 151 | m_botAction.changeAllShips(firstShip); |
| | 152 | } |
| | 153 | else m_botAction.sendPrivateMessage(name, "Use !setship before the command !terr please. Now !stop and start all again."); |
| | 154 | } |
| | 155 | |
| 131 | | { |
| 132 | | String terr1Name = null; |
| 133 | | String terr2Name = null; |
| 134 | | String ship = null; |
| 135 | | StringTokenizer terrNames = new StringTokenizer(message); |
| 136 | | |
| 137 | | int shipn; |
| 138 | | boolean ok = false; //the ok to switch terrs |
| 139 | | |
| 140 | | terrNames.nextToken(); //command !terr is first token |
| 141 | | |
| 142 | | terr1Name = terrNames.nextToken(); //then it'll have the first name |
| 143 | | |
| 144 | | if(terrNames.hasMoreTokens())//if there is another token, it should be the second name(then it is to SWITCH) |
| 145 | | { |
| 146 | | if(turretWar)//will switch just if game is ON |
| 147 | | { //switch... |
| 148 | | terr2Name = terrNames.nextToken(); //second name |
| 149 | | if(promotion)//If promotion is on, then the old terr will be SPIDER |
| 150 | | { |
| 151 | | m_botAction.setShip(terr1Name, 3); |
| 152 | | ok = true; //ok switch |
| 153 | | } |
| 154 | | |
| 155 | | else //else, the host will need to choose a #ship to old terr |
| | 179 | { //setting terrs |
| | 180 | StringTokenizer st = new StringTokenizer(message); |
| | 181 | String terrName; |
| | 182 | st.nextToken(); |
| | 183 | terrName = st.nextToken(); |
| | 184 | |
| | 185 | if(!freq1Terr && !freq0Terr) |
| | 186 | m_botAction.createNumberOfTeams(2); |
| | 187 | |
| | 188 | if(getFreq(terrName) == 1) |
| | 189 | if(!freq1Terr) |
| 157 | | if(terrNames.hasMoreTokens()) //#ship |
| 158 | | { |
| 159 | | ship = terrNames.nextToken(); |
| 160 | | shipn = Integer.parseInt(ship); //getting #ship |
| 161 | | m_botAction.setShip(terr1Name, shipn); //putting player to ship the host wanted |
| 162 | | ok = true; //ok switch |
| 163 | | } |
| 164 | | else //otherwise, he havent typed a #ship and its promotion is off. then he has to type a #ship |
| 165 | | m_botAction.sendPrivateMessage(name, "Type a ship number to "+terr1Name+" be!" ); |
| 166 | | } |
| 167 | | |
| 168 | | if(ok)//if switch ok, we'll arena it |
| | 191 | m_botAction.setShip(terrName, 5); |
| | 192 | m_botAction.sendArenaMessage(terrName+" is your the terr!",1); |
| | 193 | freq1Terr = true; |
| | 194 | }else m_botAction.sendPrivateMessage(name, "Freq 1 has a terr already, try to use !switch please"); |
| | 195 | |
| | 196 | else if(getFreq(terrName) == 0) |
| | 197 | if(!freq0Terr) |
| | 198 | { |
| | 199 | m_botAction.setShip(terrName, 5); |
| | 200 | m_botAction.sendArenaMessage(terrName+ " is your the terr!", 1); |
| | 201 | freq0Terr = true; |
| | 202 | }else m_botAction.sendPrivateMessage(name, "Freq 0 has a terr already, try to use !switch please."); |
| | 203 | } |
| | 204 | |
| | 205 | public void switchTerr( String name, String message ) |
| | 206 | { //switching terrs |
| | 207 | if(turretWar){ |
| | 208 | String oldTerr; |
| | 209 | String newTerr; |
| | 210 | String [] terr; |
| | 211 | terr = message.split(":", 2); |
| | 212 | oldTerr = terr[0].substring(8).toLowerCase(); |
| | 213 | newTerr = terr[1].toLowerCase(); |
| | 214 | |
| | 215 | if(getFreq(oldTerr) == getFreq(newTerr)) |
| 170 | | m_botAction.sendArenaMessage( terr1Name+", get back!"); |
| 171 | | m_botAction.sendArenaMessage(terr2Name + " is your new terr!", 24); |
| 172 | | m_botAction.setShip(terr2Name, 5); |
| 173 | | } |
| 174 | | |
| 175 | | //resetting scores |
| 176 | | m_botAction.scoreReset(terr1Name); //score reseting old terr |
| 177 | | m_botAction.scoreReset(terr2Name); //score reseting new terr |
| 178 | | |
| 179 | | }else m_botAction.sendPrivateMessage(name, "Just possible to switch while game is RUNNING!"); //if game isnt running, can't switch. |
| 180 | | |
| 181 | | }else //if it doesnt have any more turret, it is the pick before start !terr playername |
| 182 | | { |
| 183 | | if(!turretWar)//and it will just pick a terr before game starts |
| 184 | | { |
| 185 | | m_botAction.sendArenaMessage(terr1Name + " is your terr!", 5); |
| 186 | | m_botAction.setShip(terr1Name, 5); |
| 187 | | } |
| 188 | | else //can't use the command !terr player after game started. it should be the switch command !terr name1 newTerr |
| 189 | | m_botAction.sendPrivateMessage(name, "type the complete command to switch. !terr player1 newterr #shipPlayer1"); |
| 190 | | } |
| 191 | | } |
| | 217 | m_botAction.setShip(newTerr, 5); |
| | 218 | m_botAction.scoreReset(newTerr); |
| | 219 | m_botAction.sendArenaMessage(newTerr+ " is the new terr to the freq "+getFreq(newTerr)+"!", 21); |
| | 220 | m_botAction.setShip(oldTerr, firstShip); //set back to the first ship of !setship command |
| | 221 | m_botAction.scoreReset(oldTerr); |
| | 222 | }else m_botAction.sendPrivateMessage(name, "Choose a new terr from the same frequence please."); |
| | 223 | }else m_botAction.sendPrivateMessage(name, "Game hasn't started. Start it first please."); |
| | 224 | } |
| 211 | | m_botAction.sendArenaMessage("Promotion is on! First you'll be spiders. Get 30 kills to be promoted to lancaster!", 21 ); |
| 212 | | m_botAction.changeAllShips(3); |
| 213 | | } |
| 214 | | else if(!promotion && turretWar) //if game has started, can't start promotion after it. |
| 215 | | m_botAction.sendPrivateMessage(name, "Can't start promotion while game is running. Do it before game starts please."); |
| 216 | | } |
| | 242 | m_botAction.sendArenaMessage("Yes! Ship Promotions ON!", 24); |
| | 243 | } |
| | 244 | |
| | 245 | String messageSplit [] = message.split(":"); |
| | 246 | |
| | 247 | shipSettings object = new shipSettings(); |
| | 248 | |
| | 249 | object.setShip( Integer.parseInt(messageSplit[0].substring(6)) ); |
| | 250 | object.setKill( Integer.parseInt(messageSplit[1]) ); |
| | 251 | |
| | 252 | listShipSettings.add(object); |
| | 253 | Collections.sort(listShipSettings); |
| | 254 | |
| | 255 | } |
| 222 | | "| !guide - A GUIDE TO HOST TURRETWAR", |
| 223 | | "| !terr NAME - To pick a terr", |
| 224 | | "| !terr name1 Terr - To switch terrs if promotion on", |
| 225 | | "| !terr name1 Terr #ship1 - To switch terrs promotion if off", |
| 226 | | "| !prom - to enable promotion", |
| 227 | | "| !start - to start game (random 2, *scorereset, *shipreset and *lock commands)", |
| 228 | | "| !warp - to enable warpback", |
| | 269 | "| !guide - A GUIDE TO HOST TURRETWAR", |
| | 270 | "| !ship number - to set everyone in this ship", |
| | 271 | "| !terr name - to pick a terr", |
| | 272 | "| !switch name:terr - to switch terrs", |
| | 273 | "| !prom ship:kill - to enable promotion", |
| | 274 | "| !lprom - to check the list of promotions", |
| | 275 | "| !start - to start game (*scorereset, *shipreset and *lock)", |
| | 276 | "| !warp - to enable warpback", |