cfeat: set die chance for female
This commit is contained in:
@@ -202,6 +202,16 @@ func Born(father *Hamster, mother *Hamster) ([]*Hamster, error) {
|
|||||||
}
|
}
|
||||||
mother.Child = append(mother.Child, child...)
|
mother.Child = append(mother.Child, child...)
|
||||||
father.Child = append(father.Child, child...)
|
father.Child = append(father.Child, child...)
|
||||||
|
|
||||||
|
if mother.Age >= 500 {
|
||||||
|
var dieRoll = randNumber(0, 100)
|
||||||
|
if (mother.Age < 525 && dieRoll <= 5) ||
|
||||||
|
(mother.Age >= 525 && mother.Age < 550 && dieRoll <= 10) ||
|
||||||
|
(mother.Age >= 550 && mother.Age < 575 && dieRoll <= 25) ||
|
||||||
|
(mother.Age >= 575 && dieRoll <= 75) {
|
||||||
|
mother.Die()
|
||||||
|
}
|
||||||
|
}
|
||||||
return child, nil
|
return child, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user