@@ -109,31 +109,60 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
109109 case 1 :
110110 dischargeCount = 1
111111 case 2 :
112- threshold := 0.16
112+ threshold := 0.15
113113 if progress == firstTick {
114+ // first arc: 60% chance 1, 40% chance 2
114115 threshold = 0.6
115116 }
117+ // rest: 15% chance 1, 85% chance 2
116118 if c .Core .Rand .Float64 () < threshold {
117119 dischargeCount = 1
118120 } else {
119121 dischargeCount = 2
120122 }
121- case 3 :
122- if progress == firstTick || c .previousDischargeCount == 3 {
123- if c .Core .Rand .Float64 () < 0.5 {
123+ default : // 3 or more entities
124+ if progress == firstTick {
125+ // first arc: 55% 1, 45% 2
126+ if c .Core .Rand .Float64 () < 0.55 {
124127 dischargeCount = 1
125128 } else {
126129 dischargeCount = 2
127130 }
128- break
131+ c .previousDischargeCount = dischargeCount
132+ if dischargeCount == 0 {
133+ return
134+ }
135+ return
129136 }
130- switch rand := c .Core .Rand .Float64 (); {
131- case rand < 0.25 :
132- dischargeCount = 1
133- case rand <= 0.25 && rand < 0.75 :
134- dischargeCount = 2
135- default :
136- dischargeCount = 3
137+ rand := c .Core .Rand .Float64 ()
138+ switch c .previousDischargeCount {
139+ case 1 :
140+ // after a 1: 20% 1, 50% 2, 30% 3
141+ switch {
142+ case rand < 0.2 :
143+ dischargeCount = 1
144+ case rand < 0.7 :
145+ dischargeCount = 2
146+ default :
147+ dischargeCount = 3
148+ }
149+ case 2 :
150+ // after a 2: 25% 1, 50% 2, 25% 3
151+ switch {
152+ case rand < 0.25 :
153+ dischargeCount = 1
154+ case rand < 0.75 :
155+ dischargeCount = 2
156+ default :
157+ dischargeCount = 3
158+ }
159+ case 3 :
160+ // after a 3: next is 50% 1, 50% 2, 0% 3
161+ if rand < 0.5 {
162+ dischargeCount = 1
163+ } else {
164+ dischargeCount = 2
165+ }
137166 }
138167 }
139168 c .previousDischargeCount = dischargeCount
0 commit comments