Echo().execute(message) is now just Echo(message)

Former-commit-id: 851e141fc91b170190d6027f42f59906dda0f31f
Former-commit-id: 03dbb9da1788e1c50e84ae33d95f76194ad9a08d
This commit is contained in:
Song Minjae
2016-12-14 12:40:53 +09:00
parent 1dd156d172
commit 7078ecfed4
32 changed files with 127 additions and 121 deletions

View File

@@ -17,12 +17,12 @@ internal object SetAV : ConsoleCommand {
override fun printUsage() {
Echo.execute("${ccW}Set actor value of specific target to desired value.")
Echo.execute("${ccW}Usage: ${ccY}setav ${ccG}(id) <av> <val>")
Echo.execute("${ccW}blank ID for player. Data type will be inferred automatically.")
Echo.execute("${ccR}Contaminated (e.g. double -> string) ActorValue will crash the game,")
Echo.execute("${ccR}so make sure it will not happen before you issue the command!")
Echo.execute("${ccW}Use ${ccG}__true ${ccW}and ${ccG}__false ${ccW}for boolean value.")
Echo("${ccW}Set actor value of specific target to desired value.")
Echo("${ccW}Usage: ${ccY}setav ${ccG}(id) <av> <val>")
Echo("${ccW}blank ID for player. Data type will be inferred automatically.")
Echo("${ccR}Contaminated (e.g. double -> string) ActorValue will crash the game,")
Echo("${ccR}so make sure it will not happen before you issue the command!")
Echo("${ccW}Use ${ccG}__true ${ccW}and ${ccG}__false ${ccW}for boolean value.")
}
override fun execute(args: Array<String>) {
@@ -65,13 +65,13 @@ internal object SetAV : ConsoleCommand {
// check if av is number
if (args[1].isNum()) {
Error.execute("Illegal ActorValue ${args[1]}: ActorValue cannot be a number.")
EchoError("Illegal ActorValue ${args[1]}: ActorValue cannot be a number.")
System.err.println("[SetAV] Illegal ActorValue ${args[1]}: ActorValue cannot be a number.")
return
}
Terrarum.ingame.player.actorValue[args[1]] = `val`
Echo.execute("${ccW}Set $ccM${args[1]} ${ccW}for ${ccY}player ${ccW}to $ccG$`val`")
Echo("${ccW}Set $ccM${args[1]} ${ccW}for ${ccY}player ${ccW}to $ccG$`val`")
println("[SetAV] set ActorValue '${args[1]}' for player to '$`val`'.")
}
else if (args.size == 4) {
@@ -82,18 +82,18 @@ internal object SetAV : ConsoleCommand {
// check if av is number
if (args[2].isNum()) {
Error.execute("Illegal ActorValue ${args[2]}: ActorValue cannot be a number.")
EchoError("Illegal ActorValue ${args[2]}: ActorValue cannot be a number.")
System.err.println("[SetAV] Illegal ActorValue ${args[2]}: ActorValue cannot be a number.")
return
}
actor.actorValue[args[2]] = `val`
Echo.execute("${ccW}Set $ccM${args[2]} ${ccW}for $ccY$id ${ccW}to $ccG$`val`")
Echo("${ccW}Set $ccM${args[2]} ${ccW}for $ccY$id ${ccW}to $ccG$`val`")
println("[SetAV] set ActorValue '${args[2]}' for $actor to '$`val`'.")
}
catch (e: IllegalArgumentException) {
if (args.size == 4) {
Error.execute("${args[1]}: no actor with this ID.")
EchoError("${args[1]}: no actor with this ID.")
System.err.println("[SetAV] ${args[1]}: no actor with this ID.")
}
}