Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1- code from x2item uc file
- static function X2DataTemplate CreateBasicCoating()
- {
- local X2WeaponUpgradeTemplate Template;
- `CREATE_X2TEMPLATE(class'X2WeaponUpgradeTemplate', Template, 'Coating_Bsc');
- //Coating_Bsc to be used in loot tables and localization
- SetUpBasicCoating(Template);
- Template.BonusAbilities.AddItem('CoatingBscAbility');
- //CoatingBscAbility to be used in custom X2Ability_ItemGrantedAbilitySet
- Template.strImage = "img:///MelAtt.coating";
- return Template;
- }
- static function SetUpBasicCoating(out X2WeaponUpgradeTemplate Template)
- {
- Template.CanBeBuilt = false;
- Template.TradingPostValue = 10;
- Template.Tier = 0;
- Template.MaxQuantity = 1;
- Template.BlackMarketTexts = class'X2Item_DefaultUpgrades'.default.UpgradeBlackMarketTexts;
- Template.MutuallyExclusiveUpgrades.AddItem('Coating_Adv');
- Template.MutuallyExclusiveUpgrades.AddItem('Coating_Sup');
- Template.CanApplyUpgradeToWeaponFn = CanApplyToSword;
- }
- 2- code from x2ability uc file
- var config int COATING_BSC_HOLO;
- var localized string CoatingHoloEffecttName;
- var localized string CoatingHoloEffectDesc;
- static function array<X2DataTemplate> CreateTemplates()
- {
- local array<X2DataTemplate> Templates;
- Templates.AddItem(CoatingBscAbility());
- return Templates;
- }
- static function X2AbilityTemplate CoatingBscAbility()
- {
- local X2AbilityTemplate Template;
- local X2Effect_Persistent PersistentEffect;
- `CREATE_X2ABILITY_TEMPLATE(Template, 'CoatingBscAbility');
- Template.AbilitySourceName = 'eAbilitySource_Item';
- Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
- Template.Hostility = eHostility_Neutral;
- Template.bIsPassive = true;
- Template.AbilityToHitCalc = default.DeadEye;
- Template.AbilityTargetStyle = default.SelfTarget;
- Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);
- // This is a dummy effect so that an icon shows up in the UI.
- // Shot and Suppression abilities make use of HoloTargetEffect().
- PersistentEffect = new class'X2Effect_Persistent';
- PersistentEffect.BuildPersistentEffect(1, true, true);
- PersistentEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.LocLongDescription, Template.IconImage, true,,Template.AbilitySourceName);
- Template.AddTargetEffect(PersistentEffect);
- Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
- // Note: no visualization on purpose!
- return Template;
- }
- static function X2Effect_CoatingHolo CoatingHoloEffect()
- {
- local X2Effect_CoatingHolo Effect;
- local X2Condition_AbilityProperty AbilityCondition;
- local X2AbilityTag AbilityTag;
- Effect = new class'X2Effect_CoatingHolo';
- Effect.HitMod = default.COATING_BSC_HOLO;
- Effect.BuildPersistentEffect(1, false, false, false, eGameRule_PlayerTurnBegin);
- Effect.bRemoveWhenTargetDies = true;
- Effect.bUseSourcePlayerState = true;
- AbilityTag = X2AbilityTag(`XEXPANDCONTEXT.FindTag("Ability"));
- AbilityTag.ParseObj = Effect;
- Effect.SetDisplayInfo(ePerkBuff_Penalty, default.CoatingHoloEffecttName, `XEXPAND.ExpandString(default.CoatingHoloEffectDesc), "img:///UILibrary_PerkIcons.UIPerk_holotargeting", true);
- AbilityCondition = new class'X2Condition_AbilityProperty';
- AbilityCondition.OwnerHasSoldierAbilities.AddItem('CoatingBscAbility');
- Effect.TargetConditions.AddItem(AbilityCondition);
- // bsg-dforrest (7.27.17): need to clear out ParseObject
- AbilityTag.ParseObj = none;
- // bsg-dforrest (7.27.17): end
- return Effect;
- }
- 3- code from x2effect uc file
- class X2Effect_CoatingHolo extends X2Effect_Persistent;
- var int HitMod;
- function GetToHitAsTargetModifiers(XComGameState_Effect EffectState, XComGameState_Unit Attacker, XComGameState_Unit Target, XComGameState_Ability AbilityState, class<X2AbilityToHitCalc> ToHitType, bool bMelee, bool bFlanking, bool bIndirectFire, out array<ShotModifierInfo> ShotModifiers)
- {
- local ShotModifierInfo ModInfo;
- ModInfo.ModType = eHit_Success;
- ModInfo.Reason = FriendlyName;
- ModInfo.Value = HitMod;
- ShotModifiers.AddItem(ModInfo);
- }
- DefaultProperties
- {
- EffectName = "CoatingHoloEffect"
- DuplicateResponse = eDupe_Refresh;
- bApplyOnHit = true;
- bApplyOnMiss = false;
- }
Add Comment
Please, Sign In to add comment