当获得研究命令时,禁止等价的另一科技的升级能力。
[trigger]
Order
Events
Unit - A unit Is issued an order with no target
Conditions
Actions
Custom script: if (GetIssuedOrderId()=='Rhme') then
Player - Set the max research level of Black Gunpowder to 0 for (Triggering player)
Custom script: endif
Custom script: if (GetIssuedOrderId()=='Rhra') then
Player - Set the max research level of Iron Forged Swords to 0 for (Triggering player)
Custom script: endif
Custom script: if (GetIssuedOrderId()=='Rhar') then
Player - Set the max research level of Studded Leather Armor to 0 for (Triggering player)
Custom script: endif
Custom script: if (GetIssuedOrderId()=='Rhla') then
Player - Set the max research level of Iron Plating to 0 for (Triggering player)
Custom script: endif
[/trigger]
用于研究方向的反悔。当取消任意一科技时,恢复与其对应的科技的升级能力,但是由于所有科技都有3级,我们必须在1级以后就将科技锁定。否则在第二级和第三级时如果取消了升级就也会运行这个触发,导致等价的科技再次变得可用,所以这里也必须增加一个是否已锁定的判断。
[trigger]
Cancel
Events
Unit - A unit Cancels research
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AtkLock[(Player number of (Triggering player))] Equal to False
Or - Any (Conditions) are true
Conditions
(Researched tech-type) Equal to Iron Forged Swords
(Researched tech-type) Equal to Black Gunpowder
Then - Actions
Player - Set the max research level of Iron Forged Swords to 3 for (Triggering player)
Player - Set the max research level of Black Gunpowder to 3 for (Triggering player)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DefLock[(Player number of (Triggering player))] Equal to False
Or - Any (Conditions) are true
Conditions
(Researched tech-type) Equal to Iron Plating
(Researched tech-type) Equal to Studded Leather Armor
Then - Actions
Player - Set the max research level of Iron Plating to 3 for (Triggering player)
Player - Set the max research level of Studded Leather Armor to 3 for (Triggering player)
Else - Actions
[/trigger]
用于锁定科技的触发,任意一个科技研发完毕后就将之死锁,取消今后级别的科技的话就不会导致重新激活等价科技
[trigger]
Finsh
Events
Unit - A unit Finishes research
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Researched tech-type) Equal to Iron Forged Swords
(Researched tech-type) Equal to Black Gunpowder
Then - Actions
Set AtkLock[(Player number of (Triggering player))] = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Researched tech-type) Equal to Iron Plating
(Researched tech-type) Equal to Studded Leather Armor
Then - Actions
Set DefLock[(Player number of (Triggering player))] = True
Else - Actions
[/trigger]
有关建筑升级的三段触发:
当开始建筑升级时,禁止另外一种升级方向,其目的并非影响正在升级的塔本身,而是影响其它未升级的塔。并将其编入正在进行关键升级的单位组。
[trigger]
Start
Events
Unit - A unit Begins an upgrade
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Guard Tower
(Unit-type of (Triggering unit)) Equal to Cannon Tower
Actions
Unit Group - Add (Triggering unit) to UpgGroup[(Player number of (Triggering player))]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Guard Tower
Then - Actions
Player - Limit training of Cannon Tower to 0 for (Triggering player)
Else - Actions
Player - Limit training of Guard Tower to 0 for (Triggering player)
[/trigger]
[trigger]
UCancel
Events
Unit - A unit Cancels an upgrade
Conditions
UpgLock[(Player number of (Triggering player))] Equal to False
((Triggering unit) is in UpgGroup[(Player number of (Triggering player))]) Equal to True
Actions
Unit Group - Remove (Triggering unit) from UpgGroup[(Player number of (Triggering player))]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(UpgGroup[(Player number of (Triggering player))] is empty) Equal to True
Then - Actions
Player - Limit training of Guard Tower to -1 for (Triggering player)
Player - Limit training of Cannon Tower to -1 for (Triggering player)
Else - Actions
[/trigger]
2种升级任意中完成后锁死科技,避免其后的取消事件导致2种升级方向的恢复,另外必须判断完成的升级是否处于2种方向之一,否则会造成奥术塔升级后直接死锁,炮塔和箭塔无法通过取消第一次升级来反悔的情况。
建造完成的塔也需要退出单位组,确保组中的单位全部是正在建造关键升级的单位
[trigger]
UFinish
Events
Unit - A unit Finishes an upgrade
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Guard Tower
(Unit-type of (Triggering unit)) Equal to Cannon Tower
Actions
Set UpgLock[(Player number of (Triggering player))] = True
Unit Group - Remove (Triggering unit) from UpgGroup[(Player number of (Triggering player))]
[/trigger]