tweak cooldowns

pull/5/head
Jordan Orelli 10 years ago
parent 9ce71de6e6
commit d87326c1f4

@ -273,13 +273,13 @@ var bombCommand = &Command{
var mkBombCommand = &Command{ var mkBombCommand = &Command{
name: "mkbomb", name: "mkbomb",
help: "make a bomb. Costs 800 space duckets", help: "make a bomb. Costs 500 space duckets",
handler: func(conn *Connection, args ...string) { handler: func(conn *Connection, args ...string) {
if conn.money < 800 { if conn.money < 500 {
fmt.Fprintf(conn, "not enough money! Bombs cost 800 space duckets to build, you only have %d in the bank.\n", conn.money) fmt.Fprintf(conn, "not enough money! Bombs cost 500 space duckets to build, you only have %d in the bank.\n", conn.money)
return return
} }
conn.Withdraw(800) conn.Withdraw(500)
conn.bombs += 1 conn.bombs += 1
fmt.Fprintf(conn, "built a bomb!\n") fmt.Fprintf(conn, "built a bomb!\n")
fmt.Fprintf(conn, "bombs: %d\n", conn.bombs) fmt.Fprintf(conn, "bombs: %d\n", conn.bombs)

@ -95,6 +95,7 @@ func (c *Connection) InTransit() bool {
} }
func (c *Connection) RecordScan() { func (c *Connection) RecordScan() {
fmt.Fprintln(c, "scanning known systems for signs of life")
c.lastScan = time.Now() c.lastScan = time.Now()
After(1*time.Minute, func() { After(1*time.Minute, func() {
fmt.Fprintln(c, "scanner ready") fmt.Fprintln(c, "scanner ready")
@ -103,7 +104,7 @@ func (c *Connection) RecordScan() {
func (c *Connection) RecordBomb() { func (c *Connection) RecordBomb() {
c.lastBomb = time.Now() c.lastBomb = time.Now()
After(1500*time.Millisecond, func() { After(15*time.Second, func() {
fmt.Fprintln(c, "bomb arsenal reloaded") fmt.Fprintln(c, "bomb arsenal reloaded")
}) })
} }
@ -113,7 +114,7 @@ func (c *Connection) CanScan() bool {
} }
func (c *Connection) CanBomb() bool { func (c *Connection) CanBomb() bool {
return time.Since(c.lastBomb) > 1500*time.Millisecond return time.Since(c.lastBomb) > 15*time.Second
} }
func (c *Connection) NextScan() time.Duration { func (c *Connection) NextScan() time.Duration {
@ -121,7 +122,7 @@ func (c *Connection) NextScan() time.Duration {
} }
func (c *Connection) NextBomb() time.Duration { func (c *Connection) NextBomb() time.Duration {
return -time.Since(c.lastBomb.Add(1500 * time.Millisecond)) return -time.Since(c.lastBomb.Add(15 * time.Second))
} }
func (c *Connection) MadeKill(victim *Connection) { func (c *Connection) MadeKill(victim *Connection) {
@ -174,19 +175,13 @@ func (c *Connection) Win() {
} }
func (c *Connection) Die() { func (c *Connection) Die() {
fmt.Fprintf(c, "you were bombed. You will respawn in 2 minutes.\n") fmt.Fprintf(c, "you were bombed. You will respawn in 1 minutes.\n")
c.dead = true c.dead = true
c.System().Leave(c) c.System().Leave(c)
After(30*time.Second, func() { After(30*time.Second, func() {
fmt.Fprintf(c, "respawn in 90 seconds.\n")
})
After(time.Minute, func() {
fmt.Fprintf(c, "respawn in 60 seconds.\n")
})
After(90*time.Second, func() {
fmt.Fprintf(c, "respawn in 30 seconds.\n") fmt.Fprintf(c, "respawn in 30 seconds.\n")
}) })
After(2*time.Minute, c.Respawn) After(time.Minute, c.Respawn)
} }
func (c *Connection) Respawn() { func (c *Connection) Respawn() {

Loading…
Cancel
Save