コード例 #1
0
        public override bool Run()
        {
            try
            {
                SculptureComponent component = Target.SculptureComponent;
                if (component == null)
                {
                    return(false);
                }

                Definition definition = InteractionDefinition as Definition;

                component.mSculptureMaterial = (uint)definition.mMaterial;
                if ((definition.mMaterial == SculptureComponent.SculptureMaterial.Stone) && RandomUtil.CoinFlip())
                {
                    component.mSculptureMaterial |= 0x80;
                }
                component.mSculptureMaterial |= (uint)(RandomUtil.GetInt(0x0, SculptureComponent.kNumSculptureTexturesPerMaterial - 0x1) << 0x8);
                component.SetShaderIfNeeded();

                component.mScriptObject.RemoveAlarm(component.mMeltingAlarm);
                component.mMeltingAlarm = AlarmHandle.kInvalidHandle;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
コード例 #2
0
            public override bool Test(IActor a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return(false);
                }

                SculptureComponent component = target.SculptureComponent;

                if (component.Material == SculptureComponent.SculptureMaterial.Topiary)
                {
                    return(false);
                }

                if (component.Material == SculptureComponent.SculptureMaterial.Metal)
                {
                    return(false);
                }

                return(component != null);
            }
コード例 #3
0
ファイル: SetValue.cs プロジェクト: yakoder/NRaas
        public override bool Run()
        {
            try
            {
                int oldValue = Target.Value;

                string text = StringInputDialog.Show(Common.Localize("SetValue:MenuName"), Common.Localize("SetValue:Prompt", false, new object[] { Target.CatalogName }), oldValue.ToString());
                if (string.IsNullOrEmpty(text))
                {
                    return(false);
                }

                int newValue = 0;
                if (!int.TryParse(text, out newValue))
                {
                    SimpleMessageDialog.Show(Common.Localize("SetValue:MenuName"), Common.Localize("Numeric:Error"));
                    return(false);
                }

                int diff = newValue - oldValue;

                SculptureComponent component = Target.SculptureComponent;
                if (component != null)
                {
                    component.mAppreciationAmount += diff;
                }
                else
                {
                    Target.mValueModifier += diff;
                }
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
コード例 #4
0
ファイル: CreateSculptureEx.cs プロジェクト: Robobeurre/NRaas
			public Definition(string menuText, SculptingSkill.SkillSculptureData sculpture, SculptureComponent.SculptureMaterial material, string[] path) : base(menuText, sculpture, material, path)
			{
			}
コード例 #5
0
ファイル: Sculpturify.cs プロジェクト: Robobeurre/NRaas
 public Definition(string menuText, SculptureComponent.SculptureMaterial material, string[] menuPath)
     : base(menuText, material, menuPath)
 {}