Advertisement
Guest User

Untitled

a guest
Apr 16th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.17 KB | None | 0 0
  1. in http://www.gitorious.org/crawl/crawl/blobs/stone_soup-0.10/crawl-ref/source/xom.cc, line 1214:
  2.  
  3.     potion_effect(pot, 150, false, false, false);
  4.  
  5. in http://www.gitorious.org/crawl/crawl/blobs/stone_soup-0.10/crawl-ref/source/decks.cc, line 1496:
  6.  
  7. static void _velocity_card(int power, deck_rarity_type rarity)
  8. {
  9.     if (you.religion != GOD_CHEIBRIADOS)
  10.     {
  11.         const int power_level = get_power_level(power, rarity);
  12.         if (power_level >= 2)
  13.         {
  14.             potion_effect(POT_SPEED, random2(power / 4));
  15.             cast_swiftness(random2(power / 4));
  16.         }
  17.         else if (power_level == 1)
  18.             potion_effect(POT_SPEED, random2(power / 4));
  19.         else
  20.             cast_swiftness(random2(power / 4));
  21.     }
  22.     else
  23.     {
  24.         simple_god_message(" protects you from inadvertent hurry.");
  25.     }
  26. }
  27.  
  28. In http://www.gitorious.org/crawl/crawl/blobs/stone_soup-0.10/crawl-ref/source/decks.cc , line 1572:
  29.  
  30. static void _flight_card(int power, deck_rarity_type rarity)
  31. {
  32.     const int power_level = get_power_level(power, rarity);
  33.  
  34.     // Assume something _will_ happen.
  35.     bool success = true;
  36.  
  37.     if (power_level == 0)
  38.     {
  39.         if (!transform(random2(power/4), coinflip() ? TRAN_SPIDER : TRAN_BAT,
  40.                        true))
  41.         {
  42.             // Oops, something went wrong here (either because of cursed
  43.             // equipment or the possibility of stat loss).
  44.             success = false;
  45.         }
  46.     }
  47.     else if (power_level >= 1)
  48.     {
  49.         cast_fly(random2(power/4));
  50.         if (you.religion != GOD_CHEIBRIADOS)
  51.             cast_swiftness(random2(power/4));
  52.         else
  53.             simple_god_message(" protects you from inadvertent hurry.");
  54.     }
  55.  
  56.     if (power_level == 2) // Stacks with the above.
  57.     {
  58.         if (is_valid_shaft_level() && grd(you.pos()) == DNGN_FLOOR)
  59.         {
  60.             if (place_specific_trap(you.pos(), TRAP_SHAFT))
  61.             {
  62.                 find_trap(you.pos())->reveal();
  63.                 mpr("A shaft materialises beneath you!");
  64.             }
  65.         }
  66.     }
  67.     if (one_chance_in(4 - power_level))
  68.         potion_effect(POT_INVISIBILITY, random2(power)/4);
  69.     else if (!success)
  70.         canned_msg(MSG_NOTHING_HAPPENS);
  71. }
  72.  
  73. In http://www.gitorious.org/crawl/crawl/blobs/stone_soup-0.10/crawl-ref/source/decks.cc , line 1948:
  74.  
  75. static void _potion_card(int power, deck_rarity_type rarity)
  76. {
  77.     const int power_level = get_power_level(power, rarity);
  78.     potion_type pot_effects[] = {
  79.         POT_AGILITY, POT_AGILITY, POT_BRILLIANCE,
  80.         POT_BRILLIANCE, POT_MIGHT, POT_MIGHT,
  81.         POT_CURING, POT_CURING, POT_CONFUSION,
  82.         POT_SLOWING, POT_PARALYSIS
  83.     };
  84.    
  85.     potion_type pot = RANDOM_ELEMENT(pot_effects);
  86.  
  87.     if (power_level >= 1 && coinflip())
  88.         pot = (coinflip() ? POT_MAGIC : POT_INVISIBILITY);
  89.  
  90.     if (power_level >= 2 && coinflip())
  91.         pot = (coinflip() ? POT_SPEED : POT_RESISTANCE);
  92.  
  93.     if (you.religion == GOD_CHEIBRIADOS && pot == POT_RESISTANCE)
  94.     {
  95.         simple_god_message(" protects you from inadvertent hurry.");
  96.         pot = POT_WATER;
  97.     }
  98.        
  99.     potion_effect(pot, random2(power/4));    
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement