Advertisement
Guest User

SetInfo()

a guest
Dec 28th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.56 KB | None | 0 0
  1.             SetInfo(upgrade, mob/player/P)
  2.                 var/obj/O = src.info
  3.                 if(!O)O = new()
  4.                 else O.overlays = new/list()
  5.  
  6.                 var/text
  7.                 var/image/I = new()
  8.                 I.maptext_width = 180
  9.                 I.maptext_height = 276
  10.  
  11.                 if(src.rank && length(src.rp_cost)>src.rank) text = "<center><font align='top' size = 3><b>Name: </b><font size=2>[src.name] V[src.rank] + 1<br><br>"
  12.                 else if(src.rank > 1)text = "<center><font align='top' size = 3><b>Name: </b><font size=2>[src.name] V[src.rank]<br><br>"
  13.                 else text = "<center><font align='top' size = 3><b>Name: </b><font size=2>[src.name]<br><br>"
  14.                 text += "<font size=3><b>Description:</b><font size=2><br>[src.desc]"
  15.  
  16.                 I.maptext = text
  17.                 I.layer = FRAME_LAYER + 0.1
  18.                 I.pixel_x = 2
  19.                 I.pixel_y = -2
  20.                 O.overlays += I
  21.                 I.pixel_x=0
  22.                 I.pixel_y=0
  23.                 I.maptext = "<font color='white'>[text]"
  24.                 O.overlays += I
  25.  
  26.                 text = "<center><font size=3 align='top'><b>Stat:</b><font size=2><br>"
  27.                 var/spell/S = new src.attached_spell()
  28.                 var/spell/S2
  29.                 var/calc
  30.                 if(upgrade)
  31.                     var/t = text2path("[initial(src.attached_spell)]/V[src.rank+1]")
  32.                     if(t) S2 = new t()
  33.                 for(var/loop=1, loop<=7, loop++)
  34.                     switch(loop)
  35.                         if(1)
  36.                             if(S.spell_dmg)
  37.                                 if(S2) calc = S2.spell_dmg - S.spell_dmg
  38.                                 if(S2 && calc > 0)
  39.                                     text += "<b>Spell Damage: </b>[S.spell_dmg] + [calc]<br>"
  40.                                 else if(S2 && calc < 0)
  41.                                     text += "<b>Spell Damage: </b>[S.spell_dmg] - [-calc]<br>"
  42.                                 else
  43.                                     text += "<b>Spell Damage: </b>[S.spell_dmg]<br>"
  44.                             else if(S2 && S2.spell_dmg)
  45.                                 text += "<b>Spell Damage: </b>0 + [S2.spell_dmg]<br>"
  46.                         if(2)
  47.                             if(S.melee_dmg)
  48.                                 if(S2) calc = S2.melee_dmg - S.melee_dmg
  49.                                 if(S2 && calc > 0)
  50.                                     text += "<b>Melee Damage: </b>[S.melee_dmg] + [calc]<br>"
  51.                                 else if(S2 && calc < 0)
  52.                                     text += "<b>Melee Damage: </b>[S.melee_dmg] - [-calc]<br>"
  53.                                 else
  54.                                     text += "<b>Melee Damage: </b>[S.melee_dmg]<br>"
  55.                             else if(S2 && S2.melee_dmg)
  56.                                 text += "<b>Melee Damage: </b>0 + [S2.melee_dmg]<br>"
  57.                         if(3)
  58.                             if(S.cast_mana)
  59.                                 if(S2) calc = S2.cast_mana - S.cast_mana
  60.                                 if(S2 && calc > 0)
  61.                                     text += "<b>Mana Cost: </b>[S.cast_mana] + [calc]<br>"
  62.                                 else if(S2 && calc < 0)
  63.                                     text += "<b>Mana Cost: </b>[S.cast_mana] - [-calc]<br>"
  64.                                 else
  65.                                     text += "<b>Mana Cost: </b>[S.cast_mana]<br>"
  66.                             else if(S2 && S2.cast_mana)
  67.                                 text += "<b>Mana Cost: </b>0 + [S2.cast_mana]<br>"
  68.                         if(4)
  69.                             if(S.cooldown)
  70.                                 if(S2) calc = S2.cooldown - S.cooldown
  71.                                 if(S2 && calc > 0)
  72.                                     text += "<b>Cooldown: </b>[S.cooldown] + [calc]<br>"
  73.                                 else if(S2 && calc < 0)
  74.                                     text += "<b>Cooldown: </b>[S.cooldown] - [-calc]<br>"
  75.                                 else
  76.                                     text += "<b>Cooldown: </b>[S.cooldown]<br>"
  77.                             else if(S2 && S2.cooldown)
  78.                                 text += "<b>Cooldown: </b>0 + [S2.cooldown]<br>"
  79.                         if(5)
  80.                             if(S.tile_dmg)
  81.                                 if(S2) calc = S2.tile_dmg - S.tile_dmg
  82.                                 if(S2 && calc > 0)
  83.                                     text += "<b>Tile Damage: </b>[S.tile_dmg] + [calc]<br>"
  84.                                 else if(S2 && calc < 0)
  85.                                     text += "<b>Tile Damage: </b>[S.tile_dmg] - [-calc]<br>"
  86.                                 else
  87.                                     text += "<b>Tile Damage: </b>[S.tile_dmg]<br>"
  88.                             else if(S2 && S2.tile_dmg)
  89.                                 text += "<b>Tile Damage: </b>0 + [S2.tile_dmg]<br>"
  90.                         if(6)
  91.                             if(S.tile_duration)
  92.                                 if(S2) calc = S2.tile_duration - S.tile_duration
  93.                                 if(S2 && calc > 0)
  94.                                     text += "<b>Tile Duration: </b>[S.tile_duration] + [calc]<br>"
  95.                                 else if(S2 && calc < 0)
  96.                                     text += "<b>Tile Duration: </b>[S.tile_duration] - [-calc]<br>"
  97.                                 else
  98.                                     text += "<b>Tile Duration: </b>[S.tile_duration]<br>"
  99.                             else if(S2 && S2.tile_duration)
  100.                                 text += "<b>Tile Duration: </b>0 + [S2.tile_duration]<br>"
  101.                         if(7)
  102.                             if(S.spell_range)
  103.                                 if(S2) calc = S2.spell_range - S.spell_range
  104.                                 if(S2 && calc > 0)
  105.                                     text += "<b>Spell Range: </b>[S.spell_range] + [calc]<br>"
  106.                                 else if(S2 && calc < 0)
  107.                                     text += "<b>Spell Range: </b>[S.spell_range] - [-calc]<br>"
  108.                                 else
  109.                                     text += "<b>Spell Range: </b>[S.spell_range]<br>"
  110.                             else if(S2 && S2.spell_range)
  111.                                 text += "<b>Spell Range: </b>0 + [S2.spell_range]<br>"
  112.                 I.pixel_x = 0
  113.                 I.pixel_y = -128
  114.                 I.maptext = text
  115.                 O.overlays += I
  116.                 I.pixel_x -= 2
  117.                 I.pixel_y += 2
  118.                 I.maptext = "<font color='white'>[text]"
  119.                 O.overlays += I
  120.  
  121.                 O.screen_loc = "CENTER+1:8, CENTER-5:28"
  122.                 src.info = O
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement