Skip to content

Commit

Permalink
feat: add special case for being infected (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyFuller authored Feb 19, 2024
1 parent 5c5f791 commit 172afde
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 23 deletions.
Binary file modified content/chunk0/scaleform/001D0947392E2DD6.GFXF
Binary file not shown.
Binary file modified content/chunk0/scaleform/003F45DD25EEE393.UICB
Binary file not shown.
49 changes: 49 additions & 0 deletions content/chunk22/infected_healthbar.entity.patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"tempHash": "007DF361D5B7606D",
"tbluHash": "003EEA6770CDD15B",
"patch": [
{
"SubEntityOperation": [
"56d20ad19e891ab1",
{
"AddEventConnection": [
"OnPlayerRemoved",
"SetInfected",
{
"ref": {
"ref": "cafef77f80f5f691",
"externalScene": "[assembly:/_pro/scenes/bricks/gameessentialsbase.brick].pc_entitytype"
},
"value": {
"type": "bool",
"value": false
}
}
]
}
]
},
{
"SubEntityOperation": [
"56d20ad19e891ab1",
{
"AddEventConnection": [
"OnPlayerAdded",
"SetInfected",
{
"ref": {
"ref": "cafef77f80f5f691",
"externalScene": "[assembly:/_pro/scenes/bricks/gameessentialsbase.brick].pc_entitytype"
},
"value": {
"type": "bool",
"value": true
}
}
]
}
]
}
],
"patchVersion": 6
}
5 changes: 3 additions & 2 deletions source/animate/HealthBar/DOMDocument.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
<DOMFontItem name="_Fonts/Arial" itemID="65c8de86-00000141" linkageImportForRS="true" linkageExportInFirstFrame="false" linkageBaseClass="flash.text.Font" linkageClassName="$global" font="ArialMT" size="0" id="1" sourceLastImported="1707706947" embeddedCharacters=" !&quot;#$%&amp;&apos;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴǵǶǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄɅɆɇɈɉɊɋɌɍɎɏˆ˜ЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿҀҁ҂҃҄҅҆҇҈҉ҊҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠҡҢңҤҥҦҧҨҩҪҫҬҭҮүҰұҲҳҴҵҶҷҸҹҺһҼҽҾҿӀӁӂӃӄӅӆӇӈӉӊӋӌӍӎḀḁḂḃḄḅḆḇḈḉḊḋḌḍḎḏḐḑḒḓḔḕḖḗḘḙḚḛḜḝḞḟḠḡḢḣḤḥḦḧḨḩḪḫḬḭḮḯḰḱḲḳḴḵḶḷḸḹḺḻḼḽḾḿṀṁṂṃṄṅṆṇṈṉṊṋṌṍṎṏṐṑṒṓṔṕṖṗṘṙṚṛṜṝṞṟṠṡṢṣṤṥṦṧṨṩṪṫṬṭṮṯṰṱṲṳṴṵṶṷṸṹṺṻṼṽṾṿẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕẖẗẘẙẚẛẜẝẞẟẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹỺỻỼỽỾỿ           ​‌‍‎‏‐‑‒–—―‖‗‘’‚‛“”„‟†‡•‣․‥…‧

‪‫‬‭‮ ‰‱′″‴‵‶‷‸‹›※‼‽‾‿⁀⁁⁂⁃⁄⁅⁆⁇⁈⁉⁊⁋⁌⁍⁎⁏⁐⁑⁒⁓⁔⁕⁖⁗⁘⁙⁚⁛⁜⁝⁞ ⁠⁡⁢⁣⁤⁦⁧⁨⁩₠₡₢₣₤₥₦₧₨₩₪₫€₭₮₯₰₱₲₳₴₵₶₷₸₹₺₻₼₽₾₿⃀℀℁ℂ℃℄℅℆ℇ℈℉ℊℋℌℍℎℏℐℑℒℓ℔ℕ№℗℘ℙℚℛℜℝ℞℟℠℡™℣ℤ℥Ω℧ℨ℩KÅℬℭ℮ℯℰℱℲℳℴℵℶℷℸℹ℺℻ℼℽℾℿ⅀⅁⅂⅃⅄ⅅⅆⅇⅈⅉ⅊⅋⅌⅍ⅎ⅏⅐⅑⅒⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟"/>
</fonts>
<symbols>
<Include href="HealthBarInner.xml" loadImmediate="false" itemID="65d30858-000002a7" lastModified="1708331480"/>
<Include href="HealthBarInner.xml" loadImmediate="false" itemID="65d30858-000002a7" lastModified="1708366569"/>
<Include href="HealthBarTextBG.xml" loadImmediate="false" itemID="65d30844-0000029f" lastModified="1708329028"/>
<Include href="HealthBarView.xml" itemID="65d30821-0000029c" lastModified="1708331479"/>
<Include href="HealthBarView.xml" itemID="65d30821-0000029c" lastModified="1708357905"/>
<Include href="Tween 1.xml" itemIcon="1" loadImmediate="false" itemID="65d37a5c-0000013a" lastModified="1708358236"/>
</symbols>
<timelines>
<DOMTimeline name="Scene 1" layerDepthEnabled="true">
Expand Down
70 changes: 53 additions & 17 deletions source/animate/HealthBar/LIBRARY/HealthBarInner.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,64 @@
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="HealthBarInner" itemID="65d30858-000002a7" lastModified="1708331480">
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="HealthBarInner" itemID="65d30858-000002a7" lastModified="1708366569" lastUniqueIdentifier="2">
<timeline>
<DOMTimeline name="HealthBarInner" layerDepthEnabled="true">
<DOMTimeline name="HealthBarInner" currentFrame="120" layerDepthEnabled="true">
<layers>
<DOMLayer name="Layer_1" color="#00FFFF" current="true" isSelected="true">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[stop();]]></script>
</Actionscript>
<elements>
<DOMShape selected="true" isDrawingObject="true">
<DOMSymbolInstance libraryItemName="Tween 1" symbolType="graphic" loop="loop">
<matrix>
<Matrix tx="-1.05" ty="-1.1"/>
<Matrix tx="12.4" ty="88.9"/>
</matrix>
<fills>
<FillStyle index="1">
<SolidColor color="#FA000E"/>
</FillStyle>
</fills>
<edges>
<Edge fillStyle1="1" edges="!21 22S2|511 22!511 22|511 3581!511 3581|21 3581!21 3581|21 22"/>
<Edge cubics="!21 22(;21,22 511,22 511,22q21 22 511 22);"/>
<Edge cubics="!511 22(;511,22 511,3581 511,3581q511 22 511 3581);"/>
<Edge cubics="!511 3581(;511,3581 21,3581 21,3581q511 3581 21 3581);"/>
<Edge cubics="!21 3581(;21,3581 21,22 21,22q21 3581 21 22);"/>
</edges>
</DOMShape>
<transformationPoint>
<Point/>
</transformationPoint>
</DOMSymbolInstance>
</elements>
</DOMFrame>
<DOMFrame index="1" duration="59" tweenType="motion" motionTweenSnap="true" keyMode="22017">
<elements>
<DOMSymbolInstance libraryItemName="Tween 1" symbolType="graphic" loop="loop">
<matrix>
<Matrix tx="12.25" ty="88.95"/>
</matrix>
<transformationPoint>
<Point/>
</transformationPoint>
</DOMSymbolInstance>
</elements>
</DOMFrame>
<DOMFrame index="60" duration="60" tweenType="motion" motionTweenSnap="true" keyMode="22017">
<elements>
<DOMSymbolInstance libraryItemName="Tween 1" symbolType="graphic" centerPoint3DX="12.25" centerPoint3DY="88.95" loop="loop">
<matrix>
<Matrix tx="12.25" ty="88.95"/>
</matrix>
<transformationPoint>
<Point/>
</transformationPoint>
</DOMSymbolInstance>
</elements>
<frameColor>
<Color alphaMultiplier="0"/>
</frameColor>
</DOMFrame>
<DOMFrame index="120" tweenType="motion" motionTweenSnap="true" keyMode="22017">
<Actionscript>
<script><![CDATA[gotoAndPlay(2);]]></script>
</Actionscript>
<elements>
<DOMSymbolInstance libraryItemName="Tween 1" selected="true" symbolType="graphic" centerPoint3DX="12.25" centerPoint3DY="88.95" loop="loop">
<matrix>
<Matrix tx="12.25" ty="88.95"/>
</matrix>
<transformationPoint>
<Point/>
</transformationPoint>
</DOMSymbolInstance>
</elements>
</DOMFrame>
</frames>
Expand Down
6 changes: 3 additions & 3 deletions source/animate/HealthBar/LIBRARY/HealthBarView.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="HealthBarView" itemID="65d30821-0000029c" linkageExportForAS="true" linkageClassName="HealthBarView" lastModified="1708331479">
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="HealthBarView" itemID="65d30821-0000029c" linkageExportForAS="true" linkageClassName="HealthBarView" lastModified="1708357905">
<timeline>
<DOMTimeline name="HealthBarView" layerDepthEnabled="true">
<layers>
Expand All @@ -14,15 +14,15 @@
<Point x="13.3" y="13.3"/>
</transformationPoint>
</DOMSymbolInstance>
<DOMDynamicText name="HealthBarText" width="21.2" height="15.2" autoExpand="true" isSelectable="false">
<DOMDynamicText name="HealthBarText" left="1.15" width="18.9" height="15.2" autoExpand="true" isSelectable="false">
<matrix>
<Matrix tx="2.7" ty="190.6"/>
</matrix>
<textRuns>
<DOMTextRun>
<characters>100</characters>
<textAttrs>
<DOMTextAttrs alignment="center" aliasText="false" lineSpacing="2.55" lineHeight="15.2" size="12.75" bitmapSize="255" face="Neue Haas Grotesk Display Pro 65 Medium*" fillColor="#FFFFFF"/>
<DOMTextAttrs alignment="center" aliasText="false" lineSpacing="2.55" lineHeight="14.2" size="12.75" bitmapSize="255" face="Neue Haas Grotesk Display Pro 65 Medium*" fillColor="#FFFFFF"/>
</textAttrs>
</DOMTextRun>
</textRuns>
Expand Down
33 changes: 33 additions & 0 deletions source/animate/HealthBar/LIBRARY/Tween 1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<DOMSymbolItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ns.adobe.com/xfl/2008/" name="Tween 1" itemID="65d37a5c-0000013a" symbolType="graphic" lastModified="1708358236">
<timeline>
<DOMTimeline name="Tween 1" layerDepthEnabled="true">
<layers>
<DOMLayer name="Layer_1" color="#00FFFF" current="true" isSelected="true">
<frames>
<DOMFrame index="0" keyMode="9728">
<elements>
<DOMShape selected="true" isDrawingObject="true">
<matrix>
<Matrix tx="-13.3" ty="-90.05"/>
</matrix>
<fills>
<FillStyle index="1">
<SolidColor color="#FA000E"/>
</FillStyle>
</fills>
<edges>
<Edge fillStyle1="1" edges="!21 22|511 22!511 22|511 3581!511 3581|21 3581!21 3581|21 22"/>
<Edge cubics="!21 22(;21,22 511,22 511,22q21 22 511 22);"/>
<Edge cubics="!511 22(;511,22 511,3581 511,3581q511 22 511 3581);"/>
<Edge cubics="!511 3581(;511,3581 21,3581 21,3581q511 3581 21 3581);"/>
<Edge cubics="!21 3581(;21,3581 21,22 21,22q21 3581 21 22);"/>
</edges>
</DOMShape>
</elements>
</DOMFrame>
</frames>
</DOMLayer>
</layers>
</DOMTimeline>
</timeline>
</DOMSymbolItem>
Binary file modified source/animate/HealthBar/bin/SymDepend.cache
Binary file not shown.
Binary file modified source/bin/HealthBar.swf
Binary file not shown.
Binary file modified source/lib/HealthBar.swc
Binary file not shown.
22 changes: 21 additions & 1 deletion source/src/healthbar/HealthBar.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class HealthBar extends BaseControl {

private var m_healthBarView:HealthBarView = new HealthBarView();
private var m_currentHealth:Number;
private var m_isInfected:Boolean = false;

public function HealthBar() {
addChild(m_healthBarView);
Expand All @@ -18,13 +19,32 @@ public class HealthBar extends BaseControl {
UpdateHealth()
}

public function UpdateHealth():void {
public function SetInfected(isInfected:Boolean):void {
m_isInfected = isInfected;

if (isInfected) {
m_healthBarView.HealthBarInner.gotoAndPlay(2);
} else {
m_healthBarView.HealthBarInner.gotoAndPlay(1);
}

UpdateHealthBarColour();
}

private function UpdateHealth():void {
var m_maxHealth:Number = 100;
m_healthBarView.HealthBarInner.scaleY = m_currentHealth / m_maxHealth;
UpdateHealthBarColour();
}

private function UpdateHealthBarColour():void {
if (m_isInfected) {
var yellow:ColorTransform = new ColorTransform();
yellow.color = 0xFFFF00;
m_healthBarView.HealthBarInner.transform.colorTransform = yellow;
return;
}

var m_maxHealth:Number = 100;
var healthRatio:Number = m_currentHealth / m_maxHealth;
var m_fullHealthGreen:uint = 0x00BA00;
Expand Down

0 comments on commit 172afde

Please sign in to comment.