|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"math/rand" |
|
|
"math/rand" |
|
|
// "sort" |
|
|
|
|
|
// "strings" |
|
|
|
|
|
|
|
|
"sort" |
|
|
|
|
|
"strconv" |
|
|
|
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
|
"util" |
|
|
"util" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
for i := cp; i > b; i-- { |
|
|
for i := cp; i > b; i-- { |
|
|
r := rand.Intn(15) |
|
|
r := rand.Intn(15) |
|
|
if r < sklBrk { // it's a skill |
|
|
if r < sklBrk { // it's a skill |
|
|
q := rand.Intn(ply.TotalForces) |
|
|
|
|
|
skl := "" |
|
|
|
|
|
if q < corBrk { // it's a corporeal skill |
|
|
|
|
|
skl = util.ChoiceStr(corSkills) |
|
|
|
|
|
// fmt.Println("Selected Corporeal skill: ", skl) |
|
|
|
|
|
} else if q < ethBrk { // it's an ethereal skill |
|
|
|
|
|
skl = util.ChoiceStr(ethSkills) |
|
|
|
|
|
if skl == "Knowledge" { |
|
|
|
|
|
subskl := util.ChoiceStr(knowList) |
|
|
|
|
|
skl = "Knowledge (" + subskl + ")" |
|
|
|
|
|
} else if skl == "Area Knowledge" { |
|
|
|
|
|
subskl := util.ChoiceStr(akList) |
|
|
|
|
|
skl = "Area Knowledge (" + subskl + ")" |
|
|
|
|
|
} else if skl == "Language" { |
|
|
|
|
|
subskl := util.ChoiceStr(langList) |
|
|
|
|
|
skl = "Language (" + subskl + ")" |
|
|
|
|
|
|
|
|
if rand.Intn(3) == 0 && len(ply.Skills) != 0 { |
|
|
|
|
|
key, val := util.ChoiceMap(ply.Skills) |
|
|
|
|
|
ply.Skills[key] = val + 1 |
|
|
|
|
|
} else { |
|
|
|
|
|
q := rand.Intn(ply.TotalForces) |
|
|
|
|
|
skl := "" |
|
|
|
|
|
if q < corBrk { // it's a corporeal skill |
|
|
|
|
|
skl = util.ChoiceStr(corSkills) |
|
|
|
|
|
// fmt.Println("Selected Corporeal skill: ", skl) |
|
|
|
|
|
} else if q < ethBrk { // it's an ethereal skill |
|
|
|
|
|
skl = util.ChoiceStr(ethSkills) |
|
|
|
|
|
if skl == "Knowledge" { |
|
|
|
|
|
subskl := util.ChoiceStr(knowList) |
|
|
|
|
|
skl = "Knowledge (" + subskl + ")" |
|
|
|
|
|
} else if skl == "Area Knowledge" { |
|
|
|
|
|
subskl := util.ChoiceStr(akList) |
|
|
|
|
|
skl = "Area Knowledge (" + subskl + ")" |
|
|
|
|
|
} else if skl == "Language" { |
|
|
|
|
|
subskl := util.ChoiceStr(langList) |
|
|
|
|
|
skl = "Language (" + subskl + ")" |
|
|
|
|
|
} |
|
|
|
|
|
// fmt.Println("Selected Ethereal skill: ", skl) |
|
|
|
|
|
} else { // it's a celestial skill |
|
|
|
|
|
skl = util.ChoiceStr(celSkills) |
|
|
|
|
|
// fmt.Println("Selected Celestial skill: ", skl) |
|
|
} |
|
|
} |
|
|
// fmt.Println("Selected Ethereal skill: ", skl) |
|
|
|
|
|
} else { // it's a celestial skill |
|
|
|
|
|
skl = util.ChoiceStr(celSkills) |
|
|
|
|
|
// fmt.Println("Selected Celestial skill: ", skl) |
|
|
|
|
|
|
|
|
ply.Skills[skl] = ply.Skills[skl] + 1 |
|
|
} |
|
|
} |
|
|
ply.Skills[skl] = ply.Skills[skl] + 1 |
|
|
|
|
|
} else { // Songs |
|
|
} else { // Songs |
|
|
skl := util.ChoiceStr(songList) |
|
|
|
|
|
// fmt.Println("Selected song: ", skl) |
|
|
|
|
|
ply.Songs[skl] = ply.Songs[skl] + 1 |
|
|
|
|
|
|
|
|
if rand.Intn(3) == 0 && len(ply.Songs) != 0 { |
|
|
|
|
|
key, val := util.ChoiceMap(ply.Songs) |
|
|
|
|
|
ply.Songs[key] = val + 1 |
|
|
|
|
|
} else { |
|
|
|
|
|
skl := util.ChoiceStr(songList) |
|
|
|
|
|
// fmt.Println("Selected song: ", skl) |
|
|
|
|
|
ply.Songs[skl] = ply.Songs[skl] + 1 |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
skills := make([]string, 0, len(ply.Skills)) |
|
|
|
|
|
songs := make([]string, 0, len(ply.Songs)) |
|
|
|
|
|
// fmt.Println(len(ply.Skills), len(ply.Songs), ply.Skills, ply.Songs) |
|
|
|
|
|
for k, v := range ply.Skills { |
|
|
|
|
|
skills = append(skills, k+"/"+strconv.Itoa(v)) |
|
|
|
|
|
} |
|
|
|
|
|
for k, v := range ply.Songs { |
|
|
|
|
|
songs = append(songs, k+"/"+strconv.Itoa(v)) |
|
|
|
|
|
} |
|
|
|
|
|
sort.Strings(skills) |
|
|
|
|
|
sort.Strings(songs) |
|
|
|
|
|
sklout := strings.Join(skills[:], ", ") |
|
|
|
|
|
sngout := strings.Join(songs[:], ", ") |
|
|
|
|
|
|
|
|
fmt.Println("=== Generated In Nomine character ===") |
|
|
fmt.Println("=== Generated In Nomine character ===") |
|
|
fmt.Println(ply.Name) |
|
|
fmt.Println(ply.Name) |
|
|
fmt.Printf("Cor %d\tEth %d\tCel %d\n", |
|
|
fmt.Printf("Cor %d\tEth %d\tCel %d\n", |
|
|
|
|
|
|
|
|
ply.Agility, |
|
|
ply.Agility, |
|
|
ply.Precision, |
|
|
ply.Precision, |
|
|
ply.Perception) |
|
|
ply.Perception) |
|
|
fmt.Println("Skills: ", ply.Skills) |
|
|
|
|
|
fmt.Println("Songs: ", ply.Songs) |
|
|
|
|
|
|
|
|
fmt.Println("Skills: ", sklout) |
|
|
|
|
|
fmt.Println("Songs: ", sngout) |
|
|
fmt.Println("CP Remaining: ", b) |
|
|
fmt.Println("CP Remaining: ", b) |
|
|
} |
|
|
} |