plugintransmissionagents.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. enum InjectTypes
  2. {
  3. PLAYER_TO_ITEM,
  4. ITEM_TO_PLAYER,
  5. PLAYER_AIR_PLAYER,
  6. };
  7. /**
  8. * \brief Plugin interface for controlling of agent pool system
  9. * - access to specific agent attributes
  10. * - various transmission operations
  11. */
  12. class PluginTransmissionAgents extends PluginBase
  13. {
  14. static ref map<int, ref AgentBase> m_AgentList = new map<int, ref AgentBase>();
  15. ref map<int, string> m_SimpleAgentList = new map<int, string>; //! simple <eAgents, agentName> pair
  16. bool m_IsConstructed = false;
  17. void PluginTransmissionAgents()
  18. {
  19. //add new agents here
  20. RegisterAgent(new InfluenzaAgent);
  21. RegisterAgent(new CholeraAgent);
  22. RegisterAgent(new SalmonellaAgent);
  23. RegisterAgent(new BrainAgent);
  24. RegisterAgent(new FoodPoisonAgent);
  25. RegisterAgent(new ChemicalAgent);
  26. RegisterAgent(new WoundAgent);
  27. RegisterAgent(new NerveAgent);
  28. RegisterAgent(new HeavyMetalAgent);
  29. }
  30. /**
  31. * \brief Registers new agent into system
  32. * @param agent New agent class
  33. */
  34. void RegisterAgent(AgentBase agent)
  35. {
  36. m_AgentList.Insert(agent.GetAgentType(), agent);
  37. }
  38. /**
  39. * \brief Builds simplified list of agents in <id, name> format
  40. */
  41. void ConstructSimpleAgentList()
  42. {
  43. string agent_name;
  44. int agent_type;
  45. for(int i = 0; i < m_AgentList.Count();i++)
  46. {
  47. AgentBase agent = m_AgentList.GetElement(i);
  48. agent_name = agent.GetName();
  49. agent_type = agent.GetAgentType();
  50. m_SimpleAgentList.Insert(agent_type, agent_name);
  51. }
  52. }
  53. /**
  54. * \brief Returns map of all registered agent classes
  55. * \return map<int, ref AgentBase> map of agent classes
  56. */
  57. map<int, ref AgentBase> GetAgentList()
  58. {
  59. return m_AgentList;
  60. }
  61. /**
  62. * \brief Returns map of all registered agents in simplified format(for non-gameplay purposas mainly)
  63. * \return map<int, ref AgentBase> map of agent classes
  64. */
  65. map<int, string> GetSimpleAgentList()
  66. {
  67. if( !m_IsConstructed )
  68. {
  69. ConstructSimpleAgentList();
  70. m_IsConstructed = true;
  71. }
  72. return m_SimpleAgentList;
  73. }
  74. /**
  75. * \brief Returns agent's name from given id
  76. * @param agent_id Id of agent (see eAgents enum)
  77. * \return Agent name
  78. */
  79. static string GetNameByID(int agent_id)
  80. {
  81. return m_AgentList.Get(agent_id).GetName();
  82. }
  83. /**
  84. * \brief Removes all agents from given entity
  85. * @param target Entity to remove agents from
  86. */
  87. void RemoveAllAgents(EntityAI target)
  88. {
  89. target.RemoveAllAgents();
  90. }
  91. /**
  92. * \brief Removes given agent from given entity
  93. * @param target Entity to remove agents from
  94. * @param agent_id Id of agent (see eAgents enum)
  95. */
  96. static void RemoveAgent(EntityAI target, int agent_id)
  97. {
  98. target.RemoveAgent(agent_id);
  99. }
  100. /**
  101. * \brief Returns transferabilityIn attribute for given agent
  102. * @param agent_id Id of agent (see eAgents enum)
  103. * \return AgentBase::m_TransferabilityIn
  104. */
  105. protected float GetAgentTransferabilityIn(int agent_id)
  106. {
  107. if( !m_AgentList.Get(agent_id) ) return 0;
  108. return m_AgentList.Get(agent_id).GetTransferabilityIn();
  109. }
  110. bool GrowDuringMedicalDrugsAttack(int agentId, EMedicalDrugsType drugType, PlayerBase player)
  111. {
  112. AgentBase agent = m_AgentList.Get(agentId);
  113. if (!agent)
  114. return true;
  115. return agent.GrowDuringMedicalDrugsAttack(drugType, player);
  116. }
  117. /**
  118. * \brief Returns dieOfSpeed attribute for given agent (see GetDieOffSpeedEx())
  119. */
  120. float GetDieOffSpeed( int agent_id )
  121. {
  122. if( !m_AgentList.Get(agent_id) )
  123. return 0;
  124. return m_AgentList.Get(agent_id).GetDieOffSpeed();
  125. }
  126. /**
  127. * \brief Returns dieOfSpeed attribute for given agent
  128. * @param agent_id Id of agent (see eAgents enum)
  129. * @param player Actual player reference
  130. * \return AgentBase::m_DieOffSpeed
  131. */
  132. float GetAgentDieOffSpeedEx(int agent_id, PlayerBase player)
  133. {
  134. if( !m_AgentList.Get(agent_id) ) return true;
  135. return m_AgentList.Get(agent_id).GetDieOffSpeedEx(player);
  136. }
  137. /**
  138. * \brief Returns potency attribute for given agent (see GetAgentPotencyEx())
  139. */
  140. EStatLevels GetPotency( int agent_id )
  141. {
  142. if( !m_AgentList.Get(agent_id) )
  143. return 0;
  144. return m_AgentList.Get(agent_id).GetPotency();
  145. }
  146. /**
  147. * \brief Returns potency attribute for given agent
  148. * @param agent_id Id of agent (see eAgents enum)
  149. * @param player Actual player reference
  150. * \return AgentBase::m_Potency
  151. */
  152. EStatLevels GetAgentPotencyEx(int agent_id, PlayerBase player)
  153. {
  154. if( !m_AgentList.Get(agent_id) ) return true;
  155. return m_AgentList.Get(agent_id).GetPotencyEx(player);
  156. }
  157. /**
  158. * \brief Returns invasibility attribute for given agent
  159. * @param agent_id Id of agent (see eAgents enum)
  160. * @param player Actual player reference
  161. * \return AgentBase::m_Invasibility
  162. */
  163. float GetAgentInvasibilityEx(int agent_id, PlayerBase player)
  164. {
  165. if( !m_AgentList.Get(agent_id) ) return true;
  166. return m_AgentList.Get(agent_id).GetInvasibilityEx(player);
  167. }
  168. /**
  169. * \brief Returns antibiotics resistance attribute for given agent see GetAgentAntiboticsResistanceEx()
  170. */
  171. float GetAgentAntiboticsResistance( int agent_id )
  172. {
  173. if( !m_AgentList.Get(agent_id) ) return 0;
  174. return m_AgentList.Get(agent_id).GetAntiboticsResistance();
  175. }
  176. /**
  177. * \brief Returns antibiotics resistance attribute for given agent
  178. * @param agent_id Id of agent (see eAgents enum)
  179. * @param player Actual player reference
  180. * \return AgentBase::m_AntibioticsResistance
  181. */
  182. float GetAgentAntiboticsResistanceEx( int agent_id , PlayerBase player)
  183. {
  184. if( !m_AgentList.Get(agent_id) ) return 0;
  185. return m_AgentList.Get(agent_id).GetAntibioticsResistanceEx(player);
  186. }
  187. /**
  188. * \brief Returns transferabilityOut attribute for given agent
  189. * @param agent_id Id of agent (see eAgents enum)
  190. * \return AgentBase::m_TransferabilityOut
  191. */
  192. protected float GetAgentTransferabilityOut( int agent_id )
  193. {
  194. if(!m_AgentList.Get(agent_id)) return 0;
  195. return m_AgentList.Get(agent_id).GetTransferabilityOut();
  196. }
  197. /**
  198. * \brief Returns transferabilitAiryOut attribute for given agent
  199. * @param agent_id Id of agent (see eAgents enum)
  200. * \return AgentBase::m_TransferabilityAirOut
  201. */
  202. protected float GetAgentTransferabilityAirOut( int agent_id )
  203. {
  204. if(!m_AgentList.Get(agent_id)) return 0;
  205. return m_AgentList.Get(agent_id).GetTransferabilityAirOut();
  206. }
  207. /**
  208. * \brief Returns invasibility attribute for given agent
  209. * @param agent_id Id of agent (see eAgents enum)
  210. * \return AgentBase::m_Invasibility
  211. */
  212. float GetAgentInvasibility( int agent_id )
  213. {
  214. if( !m_AgentList.Get(agent_id) )
  215. return 0;
  216. return m_AgentList.Get(agent_id).GetInvasibility();
  217. }
  218. /**
  219. * \brief Returns stomach digetibility attribute for given agent (see GetAgentDigestibilityEx())
  220. */
  221. float GetAgentDigestibility( int agent_id )
  222. {
  223. if( !m_AgentList.Get(agent_id) )
  224. return 0;
  225. return m_AgentList.Get(agent_id).GetDigestibility();
  226. }
  227. /**
  228. * \brief Returns stomach digetibility attribute for given agent
  229. * @param agent_id Id of agent (see eAgents enum)
  230. * @param player Actual player reference
  231. * \return AgentBase::m_Digestibility
  232. */
  233. float GetAgentDigestibilityEx(int agent_id, PlayerBase player)
  234. {
  235. if (!m_AgentList.Get(agent_id))
  236. return 0;
  237. return m_AgentList.Get(agent_id).GetDigestibilityEx(player);
  238. }
  239. /**
  240. * \brief Returns max count attribute for given agent
  241. * @param agent_id Id of agent (see eAgents enum)
  242. * \return AgentBase::m_MaxCount
  243. */
  244. static int GetAgentMaxCount( int agent_id )
  245. {
  246. if( !m_AgentList.Get(agent_id) ) return 0;
  247. return m_AgentList.Get(agent_id).GetMaxCount();
  248. }
  249. /**
  250. * \brief Process transmission of agents between entities (for specified transmission type)
  251. * @param source Entity to transfer agents from
  252. * @param target Entity to transfer agents to
  253. * @param pathway Type of transmission used
  254. * @param dose_size Number of agents to be transmitted
  255. * @param agents Bit mask specifing agents to transmit
  256. * \return count Number of transmitted agents
  257. */
  258. float TransmitAgentsEx(EntityAI source, EntityAI target, int pathway, int dose_size = 1000, int agents = 0)
  259. {
  260. //Debug.Log("Transmitting agents for source: " +source.ToString()+", target: " +target.ToString(),"Agents");
  261. int sourceAgents = agents;
  262. int targetAgents;
  263. if(!sourceAgents && source) sourceAgents = source.GetAgents();//do not set sourceAgents again if already set
  264. if(target) targetAgents = target.GetAgents();
  265. int pollution = GetGame().GetMission().GetWorldData().GetPollution();
  266. float count = 0;
  267. switch (pathway)
  268. {
  269. case AGT_INV_OUT: //item leaving inventory
  270. break;
  271. case AGT_INV_IN: //item entering inventory
  272. break;
  273. case AGT_UACTION_TOUCH: //player touched the item
  274. //InjectAgents( source, targetAgents ,GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.GLOVES, player) );
  275. break;
  276. case AGT_WATER_POND:
  277. if (pollution & EPollution.HEAVYMETAL)
  278. {
  279. sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
  280. }
  281. sourceAgents = sourceAgents | eAgents.CHOLERA;
  282. InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
  283. break;
  284. case AGT_WATER_HOT_SPRING:
  285. sourceAgents = sourceAgents | eAgents.FOOD_POISON | eAgents.HEAVYMETAL;
  286. InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
  287. break;
  288. case AGT_SNOW:
  289. if (pollution & EPollution.HEAVYMETAL)
  290. {
  291. sourceAgents = sourceAgents | eAgents.HEAVYMETAL;
  292. }
  293. InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER );
  294. break;
  295. case AGT_UACTION_CONSUME:
  296. //InjectAgentsWithPlayer( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
  297. InjectAgentsWithPlayer( source, targetAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
  298. break;
  299. case AGT_UACTION_TO_PLAYER: //user action of a consumption, only from item to player
  300. InjectAgentsWithPlayerCount( target, sourceAgents , 0, dose_size, InjectTypes.ITEM_TO_PLAYER );
  301. break;
  302. case AGT_UACTION_TO_ITEM: //to transfer from the player to the consumed item
  303. InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.PLAYER_TO_ITEM );
  304. break;
  305. case AGT_TRANSFER_COPY: //transferring liquid
  306. InjectAgentsWithoutPlayer( target, sourceAgents );
  307. break;
  308. case AGT_ITEM_TO_FLESH: //transferring liquid
  309. InjectAgentsWithPlayer( target, sourceAgents , 0, 1, InjectTypes.ITEM_TO_PLAYER);
  310. break;
  311. case AGT_AIRBOURNE_BIOLOGICAL:
  312. float prot_level_mask_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( target ));
  313. float prot_level_mask_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.MASK, Man.Cast( source ));
  314. float prot_level_headgear_target = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( target ));
  315. float prot_level_headgear_source = GetProtectionLevel(DEF_BIOLOGICAL,InventorySlots.HEADGEAR, Man.Cast( source ));
  316. float prot_level_target = Math.Max(prot_level_mask_target, prot_level_headgear_target);//find the bigger of the 2, TODO: should be improved
  317. float prot_level_source = Math.Max(prot_level_mask_source, prot_level_headgear_source);//find the bigger of the 2, TODO: should be improved
  318. float prot_level_combined = 1 - (1 - prot_level_target) * (1 - prot_level_source);
  319. InjectAgentsWithPlayer( target, sourceAgents , prot_level_combined, 1, InjectTypes.PLAYER_AIR_PLAYER );
  320. break;
  321. case AGT_AIRBOURNE_CHEMICAL:
  322. float prot_level_mask_target2 = GetProtectionLevel(DEF_CHEMICAL,InventorySlots.MASK, Man.Cast( target ));
  323. count = InjectAgentWithPlayerDose( target, agents , prot_level_mask_target2, dose_size, InjectTypes.PLAYER_AIR_PLAYER );
  324. break;
  325. default:
  326. break;
  327. }
  328. return count;
  329. }
  330. /**
  331. * \brief Process transmission of agents between entities (for specified transmission type) (see TransmitAgentsEx()))
  332. */
  333. void TransmitAgents(EntityAI source, EntityAI target, int pathway, int dose_size = 1000)
  334. {
  335. TransmitAgentsEx(source, target, pathway, dose_size);
  336. }
  337. /**
  338. * \brief Injects specified agents directly to target
  339. * @param target Entity to inject agents to
  340. * @param agents Bit mask with information about agents
  341. */
  342. protected void InjectAgentsWithoutPlayer(EntityAI target, int agents)
  343. {
  344. if( target.IsItemBase() )
  345. {
  346. ItemBase ib_target = ItemBase.Cast( target );
  347. ib_target.TransferAgents(agents);
  348. }
  349. }
  350. /**
  351. * \brief Injects agents to a given target, using chance of transmission and full dose size if chance succeeds
  352. * @param target Entity to inject agents to
  353. * @param agents Bit mask with information about agents
  354. * @param protection Protection size used for chance generation <0.0; 1.0>
  355. * @param dose_size Number of agents to be transmitted
  356. * @param inject_type Type of transmission
  357. */
  358. protected void InjectAgentsWithPlayer(EntityAI target, int agents, float protection, int dose_size, int inject_type)//target,array_of_agents,protection_lvl
  359. {
  360. if(target && (agents != 0) && target.IsEntityAI() )
  361. {
  362. int bit_count = Math.GetNumberOfSetBits(agents);
  363. for (int i = 0; i < bit_count; i++)
  364. {
  365. int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
  366. if( DetermineChanceToTransmit(agent_bit, protection, inject_type))
  367. {
  368. target.InsertAgent(agent_bit,dose_size);
  369. }
  370. }
  371. }
  372. }
  373. /**
  374. * \brief Injects agents to a given target, with no probability, but the dose size is modified by m_TransferabilityOut of the agent
  375. * @param target Entity to inject agents to
  376. * @param agents Bit mask with information about agents
  377. * @param protection Protection size used for chance generation <0.0; 1.0>
  378. * @param dose_size Number of agents to be transmitted
  379. * @param inject_type Type of transmission
  380. */
  381. protected void InjectAgentsWithPlayerCount(EntityAI target, int agents, float protection, int dose_size, int inject_type)//target,array_of_agents,protection_lvl
  382. {
  383. if(target && (agents != 0) && target.IsEntityAI() )
  384. {
  385. int bit_count = Math.GetNumberOfSetBits(agents);
  386. for (int i = 0; i < bit_count; i++)
  387. {
  388. int agent_bit = Math.Pow(2,Math.GetNthBitSet(agents,i));
  389. float count = CalculateAgentsToTransmit(agent_bit, protection, dose_size, inject_type);
  390. target.InsertAgent(agent_bit,count);
  391. }
  392. }
  393. }
  394. /**
  395. * \brief Injects agent to a given target
  396. * @param target Entity to inject agents to
  397. * @param agents Bit mask with information about agents
  398. * @param protection Protection size used for chance generation <0.0; 1.0>
  399. * @param dose_size Number of agents to be transmitted
  400. * @param inject_type Type of transmission
  401. * \return count Number of injected agents (dose_size might be shrinked by chance from protection)
  402. */
  403. protected float InjectAgentWithPlayerDose(EntityAI target, int agent, float protection, float dose_size, int inject_type)//target,array_of_agents,protection_lvl
  404. {
  405. float count = CalculateAgentsToTransmit(agent, protection, dose_size, inject_type);
  406. {
  407. if(count > 0)
  408. {
  409. target.InsertAgent(agent, count);
  410. return count;
  411. }
  412. }
  413. return 0;
  414. }
  415. // !performance hog, avoid
  416. static void BuildAgentArray(int agents, array<int> agents_out)
  417. {
  418. int mask = 1;
  419. for(int i = 0; i < BIT_INT_SIZE; i++)
  420. {
  421. if( mask & agents )
  422. agents_out.Insert(mask);
  423. mask = mask * 2;
  424. }
  425. }
  426. /**
  427. * \brief Protection level of an attachment against enviromental hazard (mask/filters for example)
  428. * @param type Type of protection (see DEF_BIOLOGICAL in constants.c for example)
  429. * @param slot Inventory slot id
  430. * @param player Player reference
  431. * @param consider_filter (unused parameter for now)
  432. * @param system (unused parameter for now)
  433. * \return Attachment protechtion level
  434. */
  435. static float GetProtectionLevelEx(int type, int slot, Man player, bool consider_filter = true, int system = 0)
  436. {
  437. ItemBase attachment = ItemBase.Cast(player.GetInventory().FindAttachment(slot));
  438. if(!attachment)
  439. return 0;
  440. return attachment.GetProtectionLevel(type, consider_filter, system);
  441. }
  442. /**
  443. * \brief Protection level of an attachment against enviromental hazard (mask/filters for example) (see GetProtectionLevelEx())
  444. */
  445. protected float GetProtectionLevel(int type, int slot, Man player)
  446. {
  447. return GetProtectionLevelEx(type, slot, player);
  448. }
  449. //------------------------------------------------------------------------------------------------------
  450. /**
  451. * \brief Calculates number of agents that can be transmitted (based on given dose_size)
  452. * @param agent_id Id of agent (see eAgents enum)
  453. * @param protection Protection size used for chance generation <0.0; 1.0>
  454. * @param dose_size Number of agents to be transmitted
  455. * @param inject_type Type of transmission
  456. * \return Number of agents that will be transmitted based on the processing of attributes
  457. */
  458. protected float CalculateAgentsToTransmit(int agent_id, float protection, int dose_size, int inject_type)
  459. {
  460. //Debug.Log("protection: "+protection.ToString());
  461. //reverse the value (in config, the higher the value, the higher the protection: 0 - 1) so that we can easily interpolate between 0 and 1 by multiplication
  462. float prot = 1 - protection;
  463. //Debug.Log("prot: "+prot.ToString(), "Agents");
  464. float transf;
  465. if( inject_type == InjectTypes.PLAYER_TO_ITEM )
  466. {
  467. transf = GetAgentTransferabilityOut(agent_id);
  468. }
  469. else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
  470. {
  471. transf = GetAgentTransferabilityIn(agent_id);
  472. }
  473. else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
  474. {
  475. transf = GetAgentTransferabilityAirOut(agent_id);
  476. }
  477. //Debug.Log("transf: "+transf.ToString(), "Agents");
  478. //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
  479. float result = 1 * prot * transf * dose_size;//final formula
  480. //result = Math.Ceil(result);
  481. //Debug.Log("result: "+result.ToString(), "Agents");
  482. return result;
  483. }
  484. //------------------------------------------------------------------------------------------------------
  485. /**
  486. * \brief Agent transmission chance processing
  487. * @param agent_id Id of agent (see eAgents enum)
  488. * @param protection Protection size used for chance generation <0.0; 1.0>
  489. * @param inject_type Type of transmission
  490. * \return true if there is a chance to transmit agent
  491. */
  492. protected bool DetermineChanceToTransmit(int agent_id, float protection, int inject_type)
  493. {
  494. //Debug.Log("protection: "+protection.ToString());
  495. //reverse the value (in config, the higher the value, the higher the protection: 0 - 1) so that we can easily interpolate between 0 and 1 by multiplication
  496. float prot = 1 - protection;
  497. //Debug.Log("prot: "+prot.ToString(), "Agents");
  498. float transf;
  499. if( inject_type == InjectTypes.PLAYER_TO_ITEM )
  500. {
  501. transf = GetAgentTransferabilityOut(agent_id);
  502. }
  503. else if( inject_type == InjectTypes.ITEM_TO_PLAYER )
  504. {
  505. transf = GetAgentTransferabilityIn(agent_id);
  506. }
  507. else if( inject_type == InjectTypes.PLAYER_AIR_PLAYER )
  508. {
  509. transf = GetAgentTransferabilityAirOut(agent_id);
  510. }
  511. #ifdef DEVELOPER
  512. //Debug.Log("transf: "+transf.ToString(), "Agents");
  513. #endif
  514. //float result = GetAgentInitialCount(agent_id) * prot * transf * dose_size;//final formula
  515. bool dice = Math.RandomFloat01() < (prot * transf);
  516. //result = Math.Ceil(result);
  517. return dice;
  518. }
  519. //------------------------------------------------------------------------------------------------------
  520. //! DEPRECATED
  521. bool GrowDuringAntibioticsAttack(int agent_id, PlayerBase player)
  522. {
  523. if (!m_AgentList.Get(agent_id))
  524. return true;
  525. return m_AgentList.Get(agent_id).GrowDuringMedicalDrugsAttack(EMedicalDrugsType.ANTIBIOTICS, player);
  526. }
  527. }