Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Minion
- {
- private:
- int Attack, CurrentHP, MaxHP;
- public:
- Minion(int atk, int hp) : Attack(atk), CurrentHP(hp), MaxHP(hp) { }
- void UseDivineSpirit()
- {
- float temp = CurrentHP;
- CurrentHP += (int)temp;
- MaxHP += (int)temp;
- std::cout << "Use DS: " << Attack << "/" << CurrentHP << std::endl;
- }
- void UseArmorPlating()
- {
- CurrentHP++;
- MaxHP++;
- std::cout << "Use AP: " << Attack << "/" << CurrentHP << std::endl;
- }
- };
- int main()
- {
- Minion wisp(1, 1);
- wisp.UseArmorPlating(); // Now a 1/2 wisp
- for (int i = 0; i < 23; i++) // Repeat Armor Plating and Divine Spirit 23 times
- {
- wisp.UseArmorPlating();
- wisp.UseDivineSpirit();
- } // Wisp is now a 1/33554430
- wisp.UseArmorPlating(); // Now a 1/33554431 wisp
- wisp.UseDivineSpirit(); // Now a 1/67108863 wisp
- wisp.UseDivineSpirit(); // Now a 1/134217727 wisp
- wisp.UseDivineSpirit(); // Now a 1/268435455 wisp
- wisp.UseDivineSpirit(); // Now a 1/536870911 wisp
- wisp.UseDivineSpirit(); // Now a 1/1073741823 wisp
- wisp.UseDivineSpirit(); // Now a 1/2147483647 wisp
- return 0;
- }
- Output:
- Use AP: 1/2
- Use AP: 1/3
- Use DS: 1/6
- Use AP: 1/7
- Use DS: 1/14
- Use AP: 1/15
- Use DS: 1/30
- Use AP: 1/31
- Use DS: 1/62
- Use AP: 1/63
- Use DS: 1/126
- Use AP: 1/127
- Use DS: 1/254
- Use AP: 1/255
- Use DS: 1/510
- Use AP: 1/511
- Use DS: 1/1022
- Use AP: 1/1023
- Use DS: 1/2046
- Use AP: 1/2047
- Use DS: 1/4094
- Use AP: 1/4095
- Use DS: 1/8190
- Use AP: 1/8191
- Use DS: 1/16382
- Use AP: 1/16383
- Use DS: 1/32766
- Use AP: 1/32767
- Use DS: 1/65534
- Use AP: 1/65535
- Use DS: 1/131070
- Use AP: 1/131071
- Use DS: 1/262142
- Use AP: 1/262143
- Use DS: 1/524286
- Use AP: 1/524287
- Use DS: 1/1048574
- Use AP: 1/1048575
- Use DS: 1/2097150
- Use AP: 1/2097151
- Use DS: 1/4194302
- Use AP: 1/4194303
- Use DS: 1/8388606
- Use AP: 1/8388607
- Use DS: 1/16777214
- Use AP: 1/16777215
- Use DS: 1/33554430
- Use AP: 1/33554431
- Use DS: 1/67108863
- Use DS: 1/134217727
- Use DS: 1/268435455
- Use DS: 1/536870911
- Use DS: 1/1073741823
- Use DS: 1/2147483647
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement