CoC-Calc 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/CoC-Calc +2 -0
- data/lib/CoC-Calc.rb +40 -32
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 102dd1f37707efd35885c487ad872bffd353377d
|
4
|
+
data.tar.gz: 9d564ea37daf6679ac3e97174a35c6c76be13669
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d21e14163c689d1ee83f52643e569cf9afdb25b5451e986ad6ded3690af2a8dafc08f67eea6b3b80722a6a030f7d182345b937cd9757fe1f0ab0166048813d5
|
7
|
+
data.tar.gz: aa6398cfd2cecf44429750c521d36f3faf543069683ba7e9e56adcf50a01111a49d811e9d2e222b5afdd1142e99637634a2dbee3962595768adad762b4c16878
|
data/bin/CoC-Calc
ADDED
data/lib/CoC-Calc.rb
CHANGED
@@ -32,7 +32,9 @@ def initPuts
|
|
32
32
|
|
33
33
|
if $lvlSaveContent == ""
|
34
34
|
puts "You need to enter the levels of your troops by running 'ruby CoC-Calc.rb set_troop_lvl' if you need futher help run 'ruby CoC-Calc.rb set_troop_lvl help'!"
|
35
|
-
|
35
|
+
else
|
36
|
+
puts "Tests were successful!"
|
37
|
+
end
|
36
38
|
|
37
39
|
$lvls = $lvlSaveContent.split('||')
|
38
40
|
$lvls.each do |i|
|
@@ -225,44 +227,48 @@ def set_troop_lvl
|
|
225
227
|
end
|
226
228
|
|
227
229
|
def calc
|
228
|
-
if ARGV[1].
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
230
|
+
if ARGV[1].is_a? String
|
231
|
+
if ARGV[1].downcase == 'help'
|
232
|
+
puts 'Calc the training time and cost of your troops run "ruby CoC-Calc.rb calc [amount of barbarians] [amount of archers] [amount of goblins] [amount of giants] [amount of wallbreakers] [amount of ballons] [amount of wizards] [amount of healers] [amount of dragons] [amount of pekkas]"'
|
233
|
+
elsif File.file? "/CoC-Calc-Saves/lvl.txt"
|
234
|
+
totalCost = 0
|
235
|
+
totalTime = 0
|
233
236
|
|
234
|
-
|
237
|
+
get_troop_cost
|
235
238
|
|
236
|
-
|
239
|
+
if $troopLvlErr
|
237
240
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
241
|
+
else
|
242
|
+
totalCost += ARGV[1].to_i * $cost_barbarians
|
243
|
+
totalCost += ARGV[2].to_i * $cost_archers
|
244
|
+
totalCost += ARGV[3].to_i * $cost_goblins
|
245
|
+
totalCost += ARGV[4].to_i * $cost_giants
|
246
|
+
totalCost += ARGV[5].to_i * $cost_wallbreakers
|
247
|
+
totalCost += ARGV[6].to_i * $cost_ballons
|
248
|
+
totalCost += ARGV[7].to_i * $cost_wizards
|
249
|
+
totalCost += ARGV[8].to_i * $cost_healers
|
250
|
+
totalCost += ARGV[9].to_i * $cost_dragons
|
251
|
+
totalCost += ARGV[10].to_i * $cost_pekkas
|
249
252
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
253
|
+
totalTime += ARGV[1].to_i * 20
|
254
|
+
totalTime += ARGV[2].to_i * 25
|
255
|
+
totalTime += ARGV[3].to_i * 30
|
256
|
+
totalTime += ARGV[4].to_i * 120
|
257
|
+
totalTime += ARGV[5].to_i * 120
|
258
|
+
totalTime += ARGV[6].to_i * 380
|
259
|
+
totalTime += ARGV[7].to_i * 380
|
260
|
+
totalTime += ARGV[8].to_i * 900
|
261
|
+
totalTime += ARGV[9].to_i * 1800
|
262
|
+
totalTime += ARGV[10].to_i * 2700
|
260
263
|
|
261
|
-
|
262
|
-
|
264
|
+
puts "Your Troops will cost #{totalCost} elixir."
|
265
|
+
puts "Your total training time is #{totalTime}s."
|
266
|
+
end
|
267
|
+
else
|
268
|
+
puts "You need to enter the levels of your troops by running 'ruby CoC-Calc.rb set_troop_lvl' if you need futher help run 'ruby CoC-Calc.rb set_troop_lvl help'!"
|
263
269
|
end
|
264
270
|
else
|
265
|
-
puts "You need to
|
271
|
+
puts "You need to supply an argument (run 'CoC-Calc cost help' for help)"
|
266
272
|
end
|
267
273
|
end
|
268
274
|
|
@@ -274,4 +280,6 @@ elsif ARGV[0] == 'set_troop_lvl'
|
|
274
280
|
set_troop_lvl
|
275
281
|
elsif ARGV[0]== 'calc'
|
276
282
|
calc
|
283
|
+
else
|
284
|
+
puts "CoC-Calc up and running, Sir!"
|
277
285
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CoC-Calc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Bals
|
@@ -13,10 +13,12 @@ dependencies: []
|
|
13
13
|
description: Calculate your troop training cost and time for Clash of Clans! Written
|
14
14
|
in Ruby (runns on Mac, Windows and Linux)
|
15
15
|
email: benjustusbals@gmail.com
|
16
|
-
executables:
|
16
|
+
executables:
|
17
|
+
- CoC-Calc
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
19
20
|
files:
|
21
|
+
- bin/CoC-Calc
|
20
22
|
- lib/CoC-Calc.rb
|
21
23
|
homepage: https://github.com/BenBals/CoC-Calc
|
22
24
|
licenses:
|