func (self CombatStopEvent) ToString(receiver *database.Character) string { if receiver == self.Attacker { return utils.Colorize(utils.ColorGreen, fmt.Sprintf("You stopped attacking %s", self.Defender.GetName())) } else if receiver == self.Defender { return utils.Colorize(utils.ColorGreen, fmt.Sprintf("%s has stopped attacking you", self.Attacker.GetName())) } return "" }
func (self CombatEvent) ToString(receiver *database.Character) string { if receiver == self.Attacker { return utils.Colorize(utils.ColorRed, fmt.Sprintf("You hit %s for %v damage", self.Defender.GetName(), self.Damage)) } else if receiver == self.Defender { return utils.Colorize(utils.ColorRed, fmt.Sprintf("%s hits you for %v damage", self.Attacker.GetName(), self.Damage)) } return "" }
func (self CombatStartEvent) ToString(receiver *database.Character) string { if receiver == self.Attacker { return utils.Colorize(utils.ColorRed, fmt.Sprintf("You are attacking %s!", self.Defender.GetName())) } else if receiver == self.Defender { return utils.Colorize(utils.ColorRed, fmt.Sprintf("%s is attacking you!", self.Attacker.GetName())) } return "" }
func (self SayEvent) ToString(receiver *database.Character) string { who := "" if receiver.GetId() == self.Character.GetId() { who = "You say" } else { who = self.Character.GetName() + " says" } return utils.Colorize(utils.ColorBlue, who+", ") + utils.Colorize(utils.ColorWhite, "\""+self.Message+"\"") }
func (self *mapTile) toString() string { if self.char == ' ' { return string(self.char) } return utils.Colorize(self.color, string(self.char)) }
func (self *mapBuilder) toString() string { str := "" for z := 0; z < self.depth; z++ { var rows []string for y := 0; y < self.height; y++ { row := "" for x := 0; x < self.width; x++ { tile := self.data[z][y][x].toString() row = row + tile } rows = append(rows, row) } rows = utils.TrimLowerRows(rows) if self.depth > 1 { divider := utils.Colorize(utils.ColorWhite, "================================================================================\r\n") rows = append(rows, divider) } for _, row := range rows { str = str + row + "\r\n" } } return str }
func (self LoginEvent) ToString(receiver *database.Character) string { return utils.Colorize(utils.ColorBlue, self.Character.GetName()) + utils.Colorize(utils.ColorWhite, " has connected") }
func (self RoomUpdateEvent) ToString(receiver *database.Character) string { return utils.Colorize(utils.ColorWhite, "This room has been modified") }
func (self TellEvent) ToString(receiver *database.Character) string { return utils.Colorize(utils.ColorMagenta, fmt.Sprintf("Message from %s: ", self.From.GetName())) + utils.Colorize(utils.ColorWhite, self.Message) }
func (self EmoteEvent) ToString(receiver *database.Character) string { return utils.Colorize(utils.ColorYellow, self.Character.GetName()+" "+self.Emote) }
func (self BroadcastEvent) ToString(receiver *database.Character) string { return utils.Colorize(utils.ColorCyan, "Broadcast from "+self.Character.GetName()+": ") + utils.Colorize(utils.ColorWhite, self.Message) }