Placed dormant world rovers randomly have better base stats

This commit is contained in:
Marc Di Luzio 2020-07-24 22:56:35 +01:00
parent a93ce97b0b
commit a0e04b7e3a

View file

@ -3,6 +3,7 @@ package rove
import (
"encoding/json"
"log"
"math/rand"
"github.com/mdiluz/rove/pkg/maths"
"github.com/mdiluz/rove/proto/roveapi"
@ -76,6 +77,12 @@ func (g *NoiseWorldGen) GetObject(v maths.Vector) (obj Object) {
// Set the rover variables
r.Pos = v
// Upgrade this rover randomly
r.MaximumCharge += rand.Int() % 3
r.MaximumIntegrity += rand.Int() % 3
r.Capacity += rand.Int() % 3
r.Range += rand.Int() % 3
// For now, mark the log as corrupted
r.AddLogEntryf("log corrupted")