Thread: Bugfixes
View Single Post
  #22  
Old 10-31-2012, 07:40 AM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Default

I think this post covers this problem: http://forum.1cpublishing.eu/showthread.php?t=35519

Quote:
Originally Posted by camelotcrusade View Post
Up next - 1. Does anyone have ideas of where to even begin to fix the Crystal Collector bug? That one is really cramping my style. Yeah, I know I'm only missing out on a few points of intellect, but I know if I start spending my crystals it will be ages before I catch up.
The code you quote looks correct - do you mean you've tried 20 times or that you should have been successful 20 times (i.e. you've tried 200 times)? If you've tried 20 times, you should have (on average) got 2 potions twice, but there is no guarantee and so you may have just been unlucky. If you've tried 200 times, then there is definitely something wrong, although the code looks fine to me...

/C\/C\

Quote:
Originally Posted by camelotcrusade View Post
2. I've never seen my alchemist or my engineer mix more than one bottle when using their remix ability. Here's what the code says (line 3026, unit_special_attacks.lua):

Code:
-- ***********************************************
-- Ñîçäàíèå Çåëèé/Ãðàíàò (Àëõèìèê, Èíæåíåð)
-- ***********************************************
function special_craft_attack()
  local charge = 1
  if Attack.act_human(0) then
    if Attack.act_name(0) == "alchemist" then
      if Logic.hero_lu_item_on_body("alchemist_toolkit") then
        if 10 >= Game.CurLocRand(1, 100) then
          charge = charge + 1
        end
      end
    end
  end

  local animation = Attack.get_custom_param("animation")
  Attack.act_aseq(0, animation)
  local dmgts = Attack.aseq_time(0, "x")
  local name = Attack.get_custom_param("craft")
  local craft_name = "craft_"..name
  Attack.act_enable_attack(0, craft_name, false)
  Attack.act_enable_attack(0, name, true)
  Attack.act_charge(0, charge, name)

  local size = Attack.act_size(0)
  if Attack.act_size(0)> 2 then
    size = 2
  end
  Attack.log(0.5 + dmgts, "add_blog_chemistry_crafting_success_"..tostring(charge)..tostring(size), "name", blog_side_unit(0, 0), "special", charge)

  return true
end
I can see it looks like there is a 10% chance to do better than 1 bottle. Have I just been unlucky 20+ times or might there be something wrong here?
Reply With Quote