2024-06-08 13:52:22 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
type Item struct {
|
|
|
|
kind int
|
|
|
|
match *Match
|
2024-06-08 23:23:20 +02:00
|
|
|
owner *Client
|
2024-06-08 13:52:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i Item) name() string {
|
|
|
|
switch i.kind {
|
|
|
|
case 0:
|
|
|
|
return "Doubler"
|
2024-06-08 23:23:20 +02:00
|
|
|
case 1:
|
|
|
|
return "Beer"
|
2024-06-08 13:52:22 +02:00
|
|
|
default:
|
|
|
|
return "None"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i Item) useItem(param1 int) {
|
|
|
|
switch i.kind {
|
|
|
|
case 0:
|
|
|
|
i.match.gun.doubled = true
|
2024-06-08 23:23:20 +02:00
|
|
|
i.match.SendMessage("I doubled the damage for 1 round", i.owner)
|
|
|
|
break
|
|
|
|
case 1:
|
|
|
|
i.match.gun.Rack()
|
|
|
|
i.match.SendMessage("I rack the magazine", i.owner)
|
|
|
|
i.match.announceRounds()
|
|
|
|
break
|
|
|
|
|
2024-06-08 13:52:22 +02:00
|
|
|
}
|
|
|
|
}
|