diff options
author | alex | 2019-01-04 09:20:39 +0000 |
---|---|---|
committer | alex | 2019-01-04 09:20:39 +0000 |
commit | d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9 (patch) | |
tree | 58475851780c7cffd19db6165f5ee68d14b06cf1 /wat/db.go | |
parent | ca91956e27ab31b5cef5af4927fe37b0671ce092 (diff) | |
download | watbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.tar.gz watbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.tar.bz2 watbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.zip |
Added time limited bankrupcy, steroids for benching (don't persist across restarts), removed aliases from command list, ping, strongest, don't allow vlk to roll.
Diffstat (limited to 'wat/db.go')
-rw-r--r-- | wat/db.go | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -85,10 +85,11 @@ func (w *WatDb) Update(upd ...interface{}) { } const ( - Action_Mine ActionType = 1 - Action_Rest ActionType = 2 - Action_Lift ActionType = 3 - Action_Riot ActionType = 4 + Action_Mine ActionType = 1 + Action_Rest ActionType = 2 + Action_Lift ActionType = 3 + Action_Riot ActionType = 4 + Action_Bankrupt ActionType = 5 ) type ActionType int @@ -109,6 +110,12 @@ func (w *WatDb) Act(player *Player, actionType ActionType) { } } +func (w *WatDb) Strongest() []Player { + var user = make([]Player, 10) + w.db.Limit(10).Order("anarchy desc").Find(&user) + return user +} + func (w *WatDb) TopLost() []Player { var user = make([]Player, 10) w.db.Limit(10).Order("coins_lost desc").Find(&user) |