Esempio n. 1
0
        public VerbCategoryButton(VerbSystem system, VerbCategory category, IEnumerable <Verb> verbs, VerbType type, EntityUid target, bool?drawOnlyIcons = null) : base()
        {
            _system        = system;
            _drawOnlyIcons = drawOnlyIcons ?? category.IconsOnly;

            MouseFilter = MouseFilterMode.Stop;

            // Contents of the button stored in this box container
            var box = new BoxContainer()
            {
                Orientation = LayoutOrientation.Horizontal
            };

            // First we add the icon for the verb group
            var icon = new TextureRect
            {
                MinSize      = (ContextMenuPopup.ButtonHeight, ContextMenuPopup.ButtonHeight),
                TextureScale = (0.5f, 0.5f),
                Stretch      = TextureRect.StretchMode.KeepCentered,
            };

            if (category.Icon != null)
            {
                icon.Texture = category.Icon.Frame0();
            }
            box.AddChild(icon);

            // Some padding before the text
            box.AddChild(new Control {
                MinSize = (4, ContextMenuPopup.ButtonHeight)
            });
        public static VerbProperties VerbWithCategory(VerbCategory id)
        {
            VerbProperties verbProperties = allVerbDefs.Where((VerbProperties v) => v.category == id).FirstOrDefault();

            if (verbProperties == null)
            {
                Log.Error("Failed to find Verb with id " + id);
            }
            return(verbProperties);
        }
 public VerbStats(VerbProperties v)
 {
     this.category               = v.category;
     this.label                  = v.label;
     this.isPrimary              = v.isPrimary;
     this.minRange               = v.minRange;
     this.range                  = v.range;
     this.burstShotCount         = v.burstShotCount;
     this.ticksBetweenBurstShots = v.ticksBetweenBurstShots;
     this.noiseRadius            = v.noiseRadius;
     this.hasStandardCommand     = v.hasStandardCommand;
     this.targetable             = v.targetable;
     this.requireLineOfSight     = v.requireLineOfSight;
     this.mustCastOnOpenGround   = v.mustCastOnOpenGround;
     this.forceNormalTimeSpeed   = v.forceNormalTimeSpeed;
     this.onlyManualCast         = v.onlyManualCast;
     this.stopBurstWithoutLos    = v.stopBurstWithoutLos;
     this.commonality            = v.commonality;
     this.minIntelligence        = v.minIntelligence;
     this.consumeFuelPerShot     = v.consumeFuelPerShot;
     this.warmupTime             = v.warmupTime;
     this.defaultCooldownTime    = v.defaultCooldownTime;
     this.muzzleFlashScale       = v.muzzleFlashScale;
     this.ensureLinkedBodyPartsGroupAlwaysUsable = v.ensureLinkedBodyPartsGroupAlwaysUsable;
     this.meleeDamageBaseAmount     = v.meleeDamageBaseAmount;
     this.meleeArmorPenetrationBase = v.meleeArmorPenetrationBase;
     this.ai_IsWeapon                = v.ai_IsWeapon;
     this.ai_IsBuildingDestroyer     = v.ai_IsBuildingDestroyer;
     this.ai_AvoidFriendlyFireRadius = v.ai_AvoidFriendlyFireRadius;
     //this.forcedMissRadius = v.forcedMissRadius;
     this.accuracyTouch  = v.accuracyTouch;
     this.accuracyShort  = v.accuracyShort;
     this.accuracyMedium = v.accuracyMedium;
     this.accuracyLong   = v.accuracyLong;
     if (v.targetParams != null)
     {
         this.targetParams = new TargetingParameterStats(v.targetParams);
     }
     if (v.surpriseAttack != null)
     {
         this.surpriseAttack = new SurpriseAttackPropStats(v.surpriseAttack);
     }
     Util.AssignDefStat(v.soundCast, out this.soundCast);
     Util.AssignDefStat(v.soundCastTail, out this.soundCastTail);
     Util.AssignDefStat(v.soundAiming, out this.soundAiming);
     Util.AssignDefStat(v.meleeDamageDef, out this.meleeDamageDef);
     Util.AssignDefStat(v.impactMote, out this.impactMote);
     Util.AssignDefStat(v.linkedBodyPartsGroup, out this.linkedBodyPartsGroup);
     Util.AssignDefStat(v.defaultProjectile, out this.defaultProjectile);
     Util.AssignDefStat(v.spawnDef, out this.spawnDef);
     Util.AssignDefStat(v.colonyWideTaleDef, out this.colonyWideTaleDef);
     Util.AssignDefStat(v.bodypartTagTarget, out this.bodypartTagTarget);
     Util.AssignDefStat(v.rangedFireRulepack, out this.rangedFireRulepack);
 }
        public static VerbProperties VerbWithCategory(VerbCategory id)
        {
            VerbProperties verbProperties = (from v in NativeVerbPropertiesDatabase.allVerbDefs
                                             where v.category == id
                                             select v).FirstOrDefault();

            if (verbProperties == null)
            {
                Log.Error("Failed to find Verb with id " + id);
            }
            return(verbProperties);
        }
Esempio n. 5
0
        public Verb GetVerb(VerbCategory category)
        {
            List <Verb> allVerbs = this.AllVerbs;

            if (allVerbs != null)
            {
                for (int i = 0; i < allVerbs.Count; i++)
                {
                    if (allVerbs[i].verbProps.category == category)
                    {
                        return(allVerbs[i]);
                    }
                }
            }
            return(null);
        }