Battlefield 0.1.0 → 1.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/battlefield.rb +6 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d616d3d718f8b33cd6dcb57eb05bb5046775003
4
- data.tar.gz: a150bef37cd0386fdd50af971fff5b147e3805ab
3
+ metadata.gz: 8a30ab9a0c7ff11032b234a68767c403586a05a5
4
+ data.tar.gz: 2961494e7746dfac735df88bcedfde8696baf809
5
5
  SHA512:
6
- metadata.gz: b2d8343e16f36e62fd2215c6eba1284f3dfa1d6a8be3185e5832d1eb7f6a8991c37d1202b521174b7dd18a0ac81e79e4437f8a79b6777c1c6be9a763b9da41da
7
- data.tar.gz: 075d5eabe39d8651ea9cdfa432d11f288168a044186854f01f5e926452f7bb0dcdde640d4d0912c666ba94996e25cfbf4d0c043c62274b34ef9137ecce5b9906
6
+ metadata.gz: 243d557b3a4299f7e9563d0ed6b7f61cce9b772a43026b45131ddd3a68bc6e7a6d2773d0e51de8bad62e7963b2956305ef092e6ae63f386757a9f2315cbe4783
7
+ data.tar.gz: a53297bfa090c633b3783ab75c86160000b9a5392df91dfdef804ab76c5b7f9740264ce7a899c556990c1495f9200f3bd9debe0d947d39c8d5c408989c174d1e
@@ -18,12 +18,11 @@ class Creature
18
18
  # Damage function
19
19
  def damage(amt); @health -= amt; end
20
20
  # Rolling function - higher # = more power.
21
- def roll
22
- (1..6).to_a.sample; end
21
+ def roll; (1..6).to_a.sample; end
23
22
  # Roll twice
24
23
  def droll; self.roll + self.roll; end
25
24
  # The 1st argument is your attack power. The other is the enemy's. self heals c1 - c2 health.
26
- def heal(c1, c2)
25
+ def heal(amt)
27
26
  @health += c1 - c2
28
27
  end
29
28
  end
@@ -77,9 +76,9 @@ def battle(hero, enemy, heal = false)
77
76
  sleep 2
78
77
  end
79
78
  end
80
- # Initializes a new Creature. If no arguments are given, health is set to 0.
81
- def Creature(health = 0); Creature.new health; end
82
- # Initializes a new ArmouredCreature. By default, health is set to 0 and armour is set to 0.5
83
- def ArmouredCreature(health = 0, armour = 0.5); ArmouredCreature.new health, armour; end
79
+ # Initializes a new Creature. If no arguments are given, health is set to 1.
80
+ def Creature(health = 1); Creature.new health; end
81
+ # Initializes a new ArmouredCreature. By default, health is set to 1 and armour is set to 0.5
82
+ def ArmouredCreature(health = 1, armour = 0.5); ArmouredCreature.new health, armour; end
84
83
  # Alias for Hero.new. Remember to include the ()s if you give no arguments or you will get an error!
85
84
  def Hero(armour = 1); Hero.new(armour); end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Battlefield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Perlmutter