OpenXcom Forum
OpenXcom Forks => OXCE Support => OpenXcom Extended (OXCE) => OXCE Support Y-scripts => Topic started by: bulletdesigner on March 05, 2018, 12:42:10 pm
-
is any way to do a damage that needs surpass moral? in OXCE+of course
-
Yes, with scripts. If you have some mechanics in mind, I can write a prototype script for you.
-
My idea is to make a seductive weapon for chaos sisters/demonette like Chryssalid but instead of instant convert to zombie with no change, only get´s successful attack if unit was no moral (meanwhile it damages moral after each attack)
Making way for some more units have damage to moral and more diverse combat
-
This exactly case is not possible right now, transformation can only have flat `specialChance` percent change to success. In future I could add option to control it by scripts.
[ps]
Right now you can using scripts create that some attacks only do normal damage if morale is depleted.
-
well in that case , nevermind the zombie part.
i guess i will make seduce do stun damage, still need a attack that does stun damage if morale is depleted.
Are there any strange effects ( expect mind control/ zombification) like petrification (i guess i can deplete tu/ energy/ moral with no energy recover ), beserker touch (unit becomes beserker ), blind ? i thinking spells HOMM now :P
-
Right now you can alter all basic stats (max values too) of unit when its hit or at start of new turn.
This mean petrification is fully possible (for X turns 0 energy and half TU)
-
So where can i find the script that only does dmage if moral depletad
-
You'd have to write it using the damageUnit script hook (https://github.com/ohartenstein23/Yankes-Scripting/blob/master/yankesScript.txt#L1427). All you'd need to do is have the to_stun (or to_health, etc.) variable reduced/set to 0 if the unit's morale (unit.getMorale) is 0.
-
You'd have to write it using the damageUnit script hook (https://github.com/ohartenstein23/Yankes-Scripting/blob/master/yankesScript.txt#L1427). All you'd need to do is have the to_stun (or to_health, etc.) variable reduced/set to 0 if the unit's morale (unit.getMorale) is 0.
i should refrase my question ("on witch mod" can i find a "already" made script similar that i only need to replace some words), i appreciate the help but i only understand rullset and the basics
-
Ah okay. The problem is that this doesn't really exist in any mod; the energy shields I wrote that are in use in Piratez and XCF are related, but it would be easier to write a new script than to modify that.
items:
- type: STR_ITEM_THAT_STUNS_ON_LOW_MORALE
tags:
ITEM_STUN_ON_LOW_MORALE: 1
extended:
tags:
RuleItem:
ITEM_STUN_ON_LOW_MORALE: int
scripts:
damageUnit:
- offset: 1
code: |
var ptr RuleItem itemRuleset;
var int targetMorale;
var int stunOnLowMorale;
damaging_item.getRuleItem itemRuleset;
itemRuleset.getTag stunOnLowMorale Tag.ITEM_STUN_ON_LOW_MORALE;
if eq stunOnLowMorale 0;
return;
end;
unit.getMorale targetMorale;
if neq targetMorale 0;
set to_stun 0;
end;
return;
unit.getMorale targetMorale;
if neq targetMorale 0;
set to_stun 0;
end;
return;
Try this. Set your weapon to have some ToStun and ToMorale, and give it a value for the tag ITEM_STUN_ON_LOW_MORALE other than 0. The script will set ToStun to 0 unless the target has 0 morale. If you want it to be more complex, e.g., maybe reduced stun damage when morale is higher instead of just 0 stun damage, you'll just need to change the last 3 lines before the final 'return;' to set to_stun however you'd like.
-
Try this. Set your weapon to have some ToStun and ToMorale, and give it a value for the tag ITEM_STUN_ON_LOW_MORALE other than 0. The script will set ToStun to 0 unless the target has 0 morale. If you want it to be more complex, e.g., maybe reduced stun damage when morale is higher instead of just 0 stun damage, you'll just need to change the last 3 lines before the final 'return;' to set to_stun however you'd like.
Thks! i will try it and give feedback soon enough
--- posts merged ---
so i just tested and got my mind puzzled
- type: STR_SEDUCE
requires:
- STR_ALIENS_ONLY
tags:
ITEM_STUN_ON_LOW_MORALE: 1
size: 0.2
costSell: 2050
weight: 5
bigSprite: 267
floorSprite: 150
handSprite: 480
meleeSound: 753
meleeHitSound: 709
meleeAnimation: 48
power: 30
damageAlter:
RandomType: 3 #3-> Flat [100% - 100%]
ToStun: 1.0
ToMorale: 1.0
ArmorEffectiveness: 0.0
damageType: 6
accuracyMelee: 110
tuMelee: 15
clipSize: -1
battleType: 3
twoHanded: false
invWidth: 1
invHeight: 3
armor: 12
recover: true
attraction: 7
listOrder: 3011
So Stun damage is still applied before complete depletion of moral , so i guess i´m doing something wrong , also i don´t understand why with
power: 30
RandomType: 3 #3-> Flat [100% - 100%]
ArmorEffectiveness: 0.0
also the armor damage modifier is 1.0 to stun
and the damage is not a constant 30 (does some melee dodge plays a part in this?)
-
Did you put it in the same file as the script, or at least the part of the code that defines the tag ITEM_STUN_ON_LOW_MORALE? The part of the item ruleset that contains the tag needs to be in the same file as
extended:
tags:
RuleItem:
ITEM_STUN_ON_LOW_MORALE: int
The morale damage by the attack won't be exactly 30, since this is reduced by the target's bravery.
-
A made a file .rul with this
items:
- type: STR_SEDUCE # 3011 TEST
requires:
- STR_ALIENS_ONLY
tags:
ITEM_STUN_ON_LOW_MORALE: 1
size: 0.2
costSell: 2050
weight: 5
bigSprite: 267
floorSprite: 150
handSprite: 480
meleeSound: 753 #753 Powerswrod miss
meleeHitSound: 709 #709 chainhit
meleeAnimation: 48
power: 30
damageAlter:
RandomType: 3 #3-> Flat [100% - 100%]
ToStun: 1.0
ToMorale: 1.0
ArmorEffectiveness: 0.0 #how effective armor is against this damage. Default `0.0` for smoke and stun, `1.0` rest.
damageType: 6
accuracyMelee: 110
tuMelee: 15
clipSize: -1
battleType: 3
twoHanded: false
invWidth: 1
invHeight: 3
armor: 12
recover: true
attraction: 7
listOrder: 3011
extended:
tags:
RuleItem:
ITEM_STUN_ON_LOW_MORALE: int
scripts:
damageUnit:
- offset: 1
code: |
var ptr RuleItem itemRuleset;
var int targetMorale;
var int stunOnLowMorale;
damaging_item.getRuleItem itemRuleset;
itemRuleset.getTag stunOnLowMorale Tag.ITEM_STUN_ON_LOW_MORALE;
if eq stunOnLowMorale 0;
return;
end;
unit.getMorale targetMorale;
if neq targetMorale 0;
set to_stun 0;
end;
return;
unit.getMorale targetMorale;
if neq targetMorale 0;
set to_stun 0;
end;
return;
still apllys stun damage with some moral
-
You accidentally copied the last 6 lines of the script twice, so the script throws an error and isn't loading. Remove everything past the second-to-the-last "return;".
-
its workkss! hurray! ;D thank man
sorry about the trouble
-
No problem, glad it's working for you!