Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change civ_state calculation for better gameplay with changed setting…
…s, population calculation is now only a scale for better calculation of civ_state
- Loading branch information
Showing
4 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
$start | ||
$replace | ||
set civ_state [expr {([gamestats attribsum $populationowner expsum]+[gamestats numbuiltprodclasses $populationowner])*0.01}] | ||
$with | ||
set civ_state [get_civ_state $populationowner] | ||
$end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
$start | ||
$replace | ||
return [hmin [expr {10.0+$civ*20.0}] 22.0] | ||
proc sparetime_get_popsoll {civ} { | ||
if {$civ<0.15} { | ||
return [expr {7.0+$civ*20.0}] | ||
} elseif {$civ<0.4} { | ||
return [expr {5.2+$civ*32.0}] | ||
} else { | ||
return [hmin [expr {10.0+$civ*20.0}] 22.0] | ||
} | ||
} | ||
$with | ||
return [hmin [expr {(54.0 - 2.0*$print:POP_SOLL.0)+$civ*(5*$print:POP_SOLL.0 - 90)}] $print:POP_SOLL.0] | ||
$end | ||
proc sparetime_get_popsoll {civ} { | ||
set populationFactor [expr {$print:POP_SOLL.0/22.0}] | ||
if {$civ<0.15} { | ||
return [expr {populationFactor*(7.0+$civ*20.0)}] | ||
} elseif {$civ<0.4} { | ||
return [expr {populationFactor*(5.2+$civ*32.0)}] | ||
} else { | ||
return [expr {populationFactor*([hmin [expr {10.0+$civ*20.0}] 22.0])}] | ||
} | ||
} | ||
$end | ||
|
||
|
||
$start | ||
$replace | ||
set civ_state [expr {([gamestats attribsum $own expsum]+[gamestats numbuiltprodclasses $own])*0.01}] | ||
$with | ||
set civ_state [get_civ_state $own] | ||
$end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$start | ||
$after | ||
call scripts/misc/animclassinit.tcl | ||
|
||
|
||
$put | ||
|
||
|
||
proc get_civ_state {owner} { | ||
//get gnome list | ||
set gnomes [obj_query $owner -class Zwerg -owner $owner -cloaked 1] | ||
if {$gnomes==0} {set gnomes {}} | ||
//calculate sum of all exp of all gnomes | ||
set exp_sum 0 | ||
foreach gnome $gnomes { | ||
set gnome_exp 0 | ||
foreach attribut [get_expattrib] { | ||
fincr gnome_exp [get_attrib $gnome $attribut] | ||
} | ||
|
||
//scaling [0, MIN_EXP] with weight 1 and [MIN_EXP, MAX_EXP] with weight 1 | ||
if {$gnome_exp > $print:MIN_EXP} { | ||
fincr exp_sum 1.0 | ||
set gnome_exp [expr {$gnome_exp-$print:MIN_EXP.0}] | ||
//MAX_EXP scaling | ||
fincr exp_sum [expr {$gnome_exp/($print:MAX_EXP.0-$print:MIN_EXP.0)}] | ||
} else { | ||
//MIN_EXP scaling | ||
fincr exp_sum [expr {$gnome_exp/$print:MIN_EXP.0}] | ||
} | ||
} | ||
//population scaling | ||
set exp_sum [expr {(22.0/$print:POP_SOLL.0*$exp_sum)}] | ||
|
||
return [expr {($exp_sum+[gamestats numbuiltprodclasses $owner])*0.01}] | ||
} | ||
|
||
$end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version" : "1.0", | ||
"version" : "1.1", | ||
"author" : "cech12", | ||
|
||
"name" : { | ||
|