CerealPencil

Mod scripted effects txt file

Jul 4th, 2026
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.36 KB | None | 0 0
  1. tbop_rival_calculation = {
  2. every_country = { #random_country
  3. limit = {
  4. is_rival = ROOT
  5. # NOT = { has_country_flag = checked_by@ROOT }
  6. has_country_flag = tbop_set
  7. }
  8.  
  9. set_variable = {
  10. which = temp
  11. value = 0
  12. }
  13. change_variable = {
  14. which = temp
  15. which = tbop_fl
  16. }
  17.  
  18. PREV = {
  19. set_variable = {
  20. which = temp
  21. value = 0
  22. }
  23. change_variable = {
  24. which = temp
  25. which = PREV
  26. }
  27.  
  28. change_variable = { #new section
  29. which = tbop_rival_fl
  30. which = temp
  31. }
  32.  
  33. # if = {
  34. # limit = {
  35. # check_variable = { which = temp which = tbop_rival_fl }
  36. # }
  37.  
  38. # set_variable = {
  39. # which = tbop_rival_fl
  40. # value = 0
  41. # }
  42. # change_variable = {
  43. # which = tbop_rival_fl
  44. # which = temp
  45. # }
  46.  
  47. # random_country = {
  48. # limit = { has_country_flag = first_rival@ROOT }
  49.  
  50. # clr_country_flag = first_rival@ROOT
  51. # }
  52. # PREV = {
  53. # set_country_flag = first_rival@ROOT
  54. # }
  55. # }
  56.  
  57. }
  58.  
  59. # set_country_flag = checked_by@ROOT
  60. }
  61.  
  62. random_country = {
  63. limit = {
  64. is_rival = ROOT
  65. # NOT = { has_country_flag = checked_by@ROOT }
  66. NOT = { has_country_flag = tbop_set }
  67. }
  68.  
  69. PREV = {
  70. set_variable = {
  71. which = tbop_rival_fl
  72. value = 0
  73. }
  74. }
  75. }
  76. }
  77.  
  78. tbop_AE_from_threat = {
  79.  
  80. if = {
  81. limit = { check_variable = { which = tbop_development value = 300 } }
  82.  
  83. tbop_AE_distribution = { DIST = 320 }
  84. }
  85. else_if = {
  86. limit = { check_variable = { which = tbop_development value = 150 } }
  87.  
  88. tbop_AE_distribution = { DIST = 80 }
  89. }
  90. else_if = {
  91. limit = { check_variable = { which = tbop_development value = 75 } }
  92.  
  93. tbop_AE_distribution = { DIST = 20 }
  94. }
  95. else = {
  96. tbop_AE_distribution = { DIST = 0 }
  97. }
  98. }
  99.  
  100. tbop_AE_distribution = {
  101. # multiply_variable = { which = tbop_twice_fl value = 2 }
  102.  
  103. set_variable = { which = tbop_actual_threat value = 0 }
  104. change_variable = { which = tbop_actual_threat which = tbop_threat }
  105. set_variable = { which = ai_value value = 0 }
  106. change_variable = { which = ai_value which = tbop_threat }
  107.  
  108. every_country = {
  109. limit = {
  110. knows_country = ROOT
  111. OR = {
  112. is_rival = ROOT
  113. AND = {
  114. #threat only reaches within a certain range
  115. NOT = {
  116. border_distance = {
  117. who = ROOT
  118. distance = $DIST$
  119. }
  120. }
  121. #THIS' FL needs to be < 2x ROOT's FL to be threatened by it
  122. # NOT = {
  123. # check_variable = {
  124. # which = tbop_twice_fl
  125. # which = ROOT
  126. # }
  127. # }
  128. }
  129. }
  130. }
  131.  
  132. country_event = {
  133. id = tbop.02
  134. }
  135. }
  136. }
  137.  
  138. get_AE = {
  139. if = {
  140. limit = { NOT = { has_opinion_modifier = { who = FROM modifier = aggressive_expansion } } }
  141. set_variable = { which = tbop_current_AE value = 0 }
  142. }
  143. else_if = {
  144. limit = { tbop_AE_check = { VALUE = -10 } }
  145. if = {
  146. limit = { tbop_AE_check = { VALUE = -1 } }
  147. set_variable = { which = tbop_current_AE value = 1 }
  148. }
  149. else_if = {
  150. limit = { tbop_AE_check = { VALUE = -2 } }
  151. set_variable = { which = tbop_current_AE value = 2 }
  152. }
  153. else_if = {
  154. limit = { tbop_AE_check = { VALUE = -3 } }
  155. set_variable = { which = tbop_current_AE value = 3 }
  156. }
  157. else_if = {
  158. limit = { tbop_AE_check = { VALUE = -4 } }
  159. set_variable = { which = tbop_current_AE value = 4 }
  160. }
  161. else_if = {
  162. limit = { tbop_AE_check = { VALUE = -5 } }
  163. set_variable = { which = tbop_current_AE value = 5 }
  164. }
  165. else_if = {
  166. limit = { tbop_AE_check = { VALUE = -6 } }
  167. set_variable = { which = tbop_current_AE value = 6 }
  168. }
  169. else_if = {
  170. limit = { tbop_AE_check = { VALUE = -7 } }
  171. set_variable = { which = tbop_current_AE value = 7 }
  172. }
  173. else_if = {
  174. limit = { tbop_AE_check = { VALUE = -8 } }
  175. set_variable = { which = tbop_current_AE value = 8 }
  176. }
  177. else_if = {
  178. limit = { tbop_AE_check = { VALUE = -9 } }
  179. set_variable = { which = tbop_current_AE value = 9 }
  180. }
  181. else = {
  182. set_variable = { which = tbop_current_AE value = 10 }
  183. }
  184. }
  185. else_if = {
  186. limit = { tbop_AE_check = { VALUE = -20 } }
  187. if = {
  188. limit = { tbop_AE_check = { VALUE = -11 } }
  189. set_variable = { which = tbop_current_AE value = 11 }
  190. }
  191. else_if = {
  192. limit = { tbop_AE_check = { VALUE = -12 } }
  193. set_variable = { which = tbop_current_AE value = 12 }
  194. }
  195. else_if = {
  196. limit = { tbop_AE_check = { VALUE = -13 } }
  197. set_variable = { which = tbop_current_AE value = 13 }
  198. }
  199. else_if = {
  200. limit = { tbop_AE_check = { VALUE = -14 } }
  201. set_variable = { which = tbop_current_AE value = 14 }
  202. }
  203. else_if = {
  204. limit = { tbop_AE_check = { VALUE = -15 } }
  205. set_variable = { which = tbop_current_AE value = 15 }
  206. }
  207. else_if = {
  208. limit = { tbop_AE_check = { VALUE = -16 } }
  209. set_variable = { which = tbop_current_AE value = 16 }
  210. }
  211. else_if = {
  212. limit = { tbop_AE_check = { VALUE = -17 } }
  213. set_variable = { which = tbop_current_AE value = 17 }
  214. }
  215. else_if = {
  216. limit = { tbop_AE_check = { VALUE = -18 } }
  217. set_variable = { which = tbop_current_AE value = 18 }
  218. }
  219. else_if = {
  220. limit = { tbop_AE_check = { VALUE = -19 } }
  221. set_variable = { which = tbop_current_AE value = 19 }
  222. }
  223. else = {
  224. set_variable = { which = tbop_current_AE value = 20 }
  225. }
  226. }
  227. else_if = {
  228. limit = { tbop_AE_check = { VALUE = -30 } }
  229. if = {
  230. limit = { tbop_AE_check = { VALUE = -21 } }
  231. set_variable = { which = tbop_current_AE value = 21 }
  232. }
  233. else_if = {
  234. limit = { tbop_AE_check = { VALUE = -22 } }
  235. set_variable = { which = tbop_current_AE value = 22 }
  236. }
  237. else_if = {
  238. limit = { tbop_AE_check = { VALUE = -23 } }
  239. set_variable = { which = tbop_current_AE value = 23 }
  240. }
  241. else_if = {
  242. limit = { tbop_AE_check = { VALUE = -24 } }
  243. set_variable = { which = tbop_current_AE value = 24 }
  244. }
  245. else_if = {
  246. limit = { tbop_AE_check = { VALUE = -25 } }
  247. set_variable = { which = tbop_current_AE value = 25 }
  248. }
  249. else_if = {
  250. limit = { tbop_AE_check = { VALUE = -26 } }
  251. set_variable = { which = tbop_current_AE value = 26 }
  252. }
  253. else_if = {
  254. limit = { tbop_AE_check = { VALUE = -27 } }
  255. set_variable = { which = tbop_current_AE value = 27 }
  256. }
  257. else_if = {
  258. limit = { tbop_AE_check = { VALUE = -28 } }
  259. set_variable = { which = tbop_current_AE value = 28 }
  260. }
  261. else_if = {
  262. limit = { tbop_AE_check = { VALUE = -29 } }
  263. set_variable = { which = tbop_current_AE value = 29 }
  264. }
  265. else = {
  266. set_variable = { which = tbop_current_AE value = 30 }
  267. }
  268. }
  269. else_if = {
  270. limit = { tbop_AE_check = { VALUE = -40 } }
  271. if = {
  272. limit = { tbop_AE_check = { VALUE = -31 } }
  273. set_variable = { which = tbop_current_AE value = 31 }
  274. }
  275. else_if = {
  276. limit = { tbop_AE_check = { VALUE = -32 } }
  277. set_variable = { which = tbop_current_AE value = 32 }
  278. }
  279. else_if = {
  280. limit = { tbop_AE_check = { VALUE = -33 } }
  281. set_variable = { which = tbop_current_AE value = 33 }
  282. }
  283. else_if = {
  284. limit = { tbop_AE_check = { VALUE = -34 } }
  285. set_variable = { which = tbop_current_AE value = 34 }
  286. }
  287. else_if = {
  288. limit = { tbop_AE_check = { VALUE = -35 } }
  289. set_variable = { which = tbop_current_AE value = 35 }
  290. }
  291. else_if = {
  292. limit = { tbop_AE_check = { VALUE = -36 } }
  293. set_variable = { which = tbop_current_AE value = 36 }
  294. }
  295. else_if = {
  296. limit = { tbop_AE_check = { VALUE = -37 } }
  297. set_variable = { which = tbop_current_AE value = 37 }
  298. }
  299. else_if = {
  300. limit = { tbop_AE_check = { VALUE = -38 } }
  301. set_variable = { which = tbop_current_AE value = 38 }
  302. }
  303. else_if = {
  304. limit = { tbop_AE_check = { VALUE = -39 } }
  305. set_variable = { which = tbop_current_AE value = 39 }
  306. }
  307. else = {
  308. set_variable = { which = tbop_current_AE value = 40 }
  309. }
  310. }
  311. else_if = {
  312. limit = { tbop_AE_check = { VALUE = -50 } }
  313. if = {
  314. limit = { tbop_AE_check = { VALUE = -41 } }
  315. set_variable = { which = tbop_current_AE value = 41 }
  316. }
  317. else_if = {
  318. limit = { tbop_AE_check = { VALUE = -42 } }
  319. set_variable = { which = tbop_current_AE value = 42 }
  320. }
  321. else_if = {
  322. limit = { tbop_AE_check = { VALUE = -43 } }
  323. set_variable = { which = tbop_current_AE value = 43 }
  324. }
  325. else_if = {
  326. limit = { tbop_AE_check = { VALUE = -44 } }
  327. set_variable = { which = tbop_current_AE value = 44 }
  328. }
  329. else_if = {
  330. limit = { tbop_AE_check = { VALUE = -45 } }
  331. set_variable = { which = tbop_current_AE value = 45 }
  332. }
  333. else_if = {
  334. limit = { tbop_AE_check = { VALUE = -46 } }
  335. set_variable = { which = tbop_current_AE value = 46 }
  336. }
  337. else_if = {
  338. limit = { tbop_AE_check = { VALUE = -47 } }
  339. set_variable = { which = tbop_current_AE value = 47 }
  340. }
  341. else_if = {
  342. limit = { tbop_AE_check = { VALUE = -48 } }
  343. set_variable = { which = tbop_current_AE value = 48 }
  344. }
  345. else_if = {
  346. limit = { tbop_AE_check = { VALUE = -49 } }
  347. set_variable = { which = tbop_current_AE value = 49 }
  348. }
  349. else = {
  350. set_variable = { which = tbop_current_AE value = 50 }
  351. }
  352. }
  353. else_if = {
  354. limit = { tbop_AE_check = { VALUE = -60 } }
  355. if = {
  356. limit = { tbop_AE_check = { VALUE = -51 } }
  357. set_variable = { which = tbop_current_AE value = 51 }
  358. }
  359. else_if = {
  360. limit = { tbop_AE_check = { VALUE = -52 } }
  361. set_variable = { which = tbop_current_AE value = 52 }
  362. }
  363. else_if = {
  364. limit = { tbop_AE_check = { VALUE = -53 } }
  365. set_variable = { which = tbop_current_AE value = 53 }
  366. }
  367. else_if = {
  368. limit = { tbop_AE_check = { VALUE = -54 } }
  369. set_variable = { which = tbop_current_AE value = 54 }
  370. }
  371. else_if = {
  372. limit = { tbop_AE_check = { VALUE = -55 } }
  373. set_variable = { which = tbop_current_AE value = 55 }
  374. }
  375. else_if = {
  376. limit = { tbop_AE_check = { VALUE = -56 } }
  377. set_variable = { which = tbop_current_AE value = 56 }
  378. }
  379. else_if = {
  380. limit = { tbop_AE_check = { VALUE = -57 } }
  381. set_variable = { which = tbop_current_AE value = 57 }
  382. }
  383. else_if = {
  384. limit = { tbop_AE_check = { VALUE = -58 } }
  385. set_variable = { which = tbop_current_AE value = 58 }
  386. }
  387. else_if = {
  388. limit = { tbop_AE_check = { VALUE = -59 } }
  389. set_variable = { which = tbop_current_AE value = 59 }
  390. }
  391. else = {
  392. set_variable = { which = tbop_current_AE value = 60 }
  393. }
  394. }
  395. else_if = {
  396. limit = { tbop_AE_check = { VALUE = -70 } }
  397. if = {
  398. limit = { tbop_AE_check = { VALUE = -61 } }
  399. set_variable = { which = tbop_current_AE value = 61 }
  400. }
  401. else_if = {
  402. limit = { tbop_AE_check = { VALUE = -62 } }
  403. set_variable = { which = tbop_current_AE value = 62 }
  404. }
  405. else_if = {
  406. limit = { tbop_AE_check = { VALUE = -63 } }
  407. set_variable = { which = tbop_current_AE value = 63 }
  408. }
  409. else_if = {
  410. limit = { tbop_AE_check = { VALUE = -64 } }
  411. set_variable = { which = tbop_current_AE value = 64 }
  412. }
  413. else_if = {
  414. limit = { tbop_AE_check = { VALUE = -65 } }
  415. set_variable = { which = tbop_current_AE value = 65 }
  416. }
  417. else_if = {
  418. limit = { tbop_AE_check = { VALUE = -66 } }
  419. set_variable = { which = tbop_current_AE value = 66 }
  420. }
  421. else_if = {
  422. limit = { tbop_AE_check = { VALUE = -67 } }
  423. set_variable = { which = tbop_current_AE value = 67 }
  424. }
  425. else_if = {
  426. limit = { tbop_AE_check = { VALUE = -68 } }
  427. set_variable = { which = tbop_current_AE value = 68 }
  428. }
  429. else_if = {
  430. limit = { tbop_AE_check = { VALUE = -69 } }
  431. set_variable = { which = tbop_current_AE value = 69 }
  432. }
  433. else = {
  434. set_variable = { which = tbop_current_AE value = 70 }
  435. }
  436. }
  437. else_if = {
  438. limit = { tbop_AE_check = { VALUE = -80 } }
  439. if = {
  440. limit = { tbop_AE_check = { VALUE = -71 } }
  441. set_variable = { which = tbop_current_AE value = 71 }
  442. }
  443. else_if = {
  444. limit = { tbop_AE_check = { VALUE = -72 } }
  445. set_variable = { which = tbop_current_AE value = 72 }
  446. }
  447. else_if = {
  448. limit = { tbop_AE_check = { VALUE = -73 } }
  449. set_variable = { which = tbop_current_AE value = 73 }
  450. }
  451. else_if = {
  452. limit = { tbop_AE_check = { VALUE = -74 } }
  453. set_variable = { which = tbop_current_AE value = 74 }
  454. }
  455. else_if = {
  456. limit = { tbop_AE_check = { VALUE = -75 } }
  457. set_variable = { which = tbop_current_AE value = 75 }
  458. }
  459. else_if = {
  460. limit = { tbop_AE_check = { VALUE = -76 } }
  461. set_variable = { which = tbop_current_AE value = 76 }
  462. }
  463. else_if = {
  464. limit = { tbop_AE_check = { VALUE = -77 } }
  465. set_variable = { which = tbop_current_AE value = 77 }
  466. }
  467. else_if = {
  468. limit = { tbop_AE_check = { VALUE = -78 } }
  469. set_variable = { which = tbop_current_AE value = 78 }
  470. }
  471. else_if = {
  472. limit = { tbop_AE_check = { VALUE = -79 } }
  473. set_variable = { which = tbop_current_AE value = 79 }
  474. }
  475. else = {
  476. set_variable = { which = tbop_current_AE value = 80 }
  477. }
  478. }
  479. else_if = {
  480. limit = { tbop_AE_check = { VALUE = -90 } }
  481. if = {
  482. limit = { tbop_AE_check = { VALUE = -81 } }
  483. set_variable = { which = tbop_current_AE value = 81 }
  484. }
  485. else_if = {
  486. limit = { tbop_AE_check = { VALUE = -82 } }
  487. set_variable = { which = tbop_current_AE value = 82 }
  488. }
  489. else_if = {
  490. limit = { tbop_AE_check = { VALUE = -83 } }
  491. set_variable = { which = tbop_current_AE value = 83 }
  492. }
  493. else_if = {
  494. limit = { tbop_AE_check = { VALUE = -84 } }
  495. set_variable = { which = tbop_current_AE value = 84 }
  496. }
  497. else_if = {
  498. limit = { tbop_AE_check = { VALUE = -85 } }
  499. set_variable = { which = tbop_current_AE value = 85 }
  500. }
  501. else_if = {
  502. limit = { tbop_AE_check = { VALUE = -86 } }
  503. set_variable = { which = tbop_current_AE value = 86 }
  504. }
  505. else_if = {
  506. limit = { tbop_AE_check = { VALUE = -87 } }
  507. set_variable = { which = tbop_current_AE value = 87 }
  508. }
  509. else_if = {
  510. limit = { tbop_AE_check = { VALUE = -88 } }
  511. set_variable = { which = tbop_current_AE value = 88 }
  512. }
  513. else_if = {
  514. limit = { tbop_AE_check = { VALUE = -89 } }
  515. set_variable = { which = tbop_current_AE value = 89 }
  516. }
  517. else = {
  518. set_variable = { which = tbop_current_AE value = 90 }
  519. }
  520. }
  521. else = {
  522. if = {
  523. limit = { tbop_AE_check = { VALUE = -91 } }
  524. set_variable = { which = tbop_current_AE value = 91 }
  525. }
  526. else_if = {
  527. limit = { tbop_AE_check = { VALUE = -92 } }
  528. set_variable = { which = tbop_current_AE value = 92 }
  529. }
  530. else_if = {
  531. limit = { tbop_AE_check = { VALUE = -93 } }
  532. set_variable = { which = tbop_current_AE value = 93 }
  533. }
  534. else_if = {
  535. limit = { tbop_AE_check = { VALUE = -94 } }
  536. set_variable = { which = tbop_current_AE value = 94 }
  537. }
  538. else_if = {
  539. limit = { tbop_AE_check = { VALUE = -95 } }
  540. set_variable = { which = tbop_current_AE value = 95 }
  541. }
  542. else_if = {
  543. limit = { tbop_AE_check = { VALUE = -96 } }
  544. set_variable = { which = tbop_current_AE value = 96 }
  545. }
  546. else_if = {
  547. limit = { tbop_AE_check = { VALUE = -97 } }
  548. set_variable = { which = tbop_current_AE value = 97 }
  549. }
  550. else_if = {
  551. limit = { tbop_AE_check = { VALUE = -98 } }
  552. set_variable = { which = tbop_current_AE value = 98 }
  553. }
  554. else_if = {
  555. limit = { tbop_AE_check = { VALUE = -99 } }
  556. set_variable = { which = tbop_current_AE value = 99 }
  557. }
  558. else = {
  559. set_variable = { which = tbop_current_AE value = 100 }
  560. }
  561. }
  562. }
  563.  
  564. give_AE = {
  565. if = {
  566. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  567. if = {
  568. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  569. add_opinion = {
  570. who = FROM
  571. modifier = aggressive_expansion
  572. }
  573. change_variable = { which = tbop_current_AE value = 1 }
  574. }
  575. if = {
  576. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  577. add_opinion = {
  578. who = FROM
  579. modifier = aggressive_expansion
  580. }
  581. change_variable = { which = tbop_current_AE value = 1 }
  582. }
  583. if = {
  584. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  585. add_opinion = {
  586. who = FROM
  587. modifier = aggressive_expansion
  588. }
  589. change_variable = { which = tbop_current_AE value = 1 }
  590. }
  591. if = {
  592. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  593. add_opinion = {
  594. who = FROM
  595. modifier = aggressive_expansion
  596. }
  597. change_variable = { which = tbop_current_AE value = 1 }
  598. }
  599. if = {
  600. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  601. add_opinion = {
  602. who = FROM
  603. modifier = aggressive_expansion
  604. }
  605. change_variable = { which = tbop_current_AE value = 1 }
  606. }
  607. if = {
  608. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  609. add_opinion = {
  610. who = FROM
  611. modifier = aggressive_expansion
  612. }
  613. change_variable = { which = tbop_current_AE value = 1 }
  614. }
  615. if = {
  616. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  617. add_opinion = {
  618. who = FROM
  619. modifier = aggressive_expansion
  620. }
  621. change_variable = { which = tbop_current_AE value = 1 }
  622. }
  623. if = {
  624. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  625. add_opinion = {
  626. who = FROM
  627. modifier = aggressive_expansion
  628. }
  629. change_variable = { which = tbop_current_AE value = 1 }
  630. }
  631. if = {
  632. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  633. add_opinion = {
  634. who = FROM
  635. modifier = aggressive_expansion
  636. }
  637. change_variable = { which = tbop_current_AE value = 1 }
  638. }
  639. if = {
  640. limit = { check_variable = { which = tbop_actual_threat which = tbop_current_AE } }
  641. add_opinion = {
  642. who = FROM
  643. modifier = aggressive_expansion
  644. }
  645. change_variable = { which = tbop_current_AE value = 1 }
  646. }
  647. }
  648. }
  649.  
  650.  
  651.  
  652. # our base threat value:
  653. # this is a proportional value, having a FL equivalent to 1.5x that of our biggest rival's means 50 base threat,
  654. # before applying modifiers
  655. # -from: our FL:
  656. # -our biggest rival's FL:
  657. # this value is further modified by the percentage of our foreign development
  658. # -currently at x%
  659.  
  660. # if not rival
  661. # -
  662.  
Advertisement
Add Comment
Please, Sign In to add comment